Skip to main content

Methods

asyncIterator

Returns

AsyncIterator<T, any, any>

add()

Attach key. Returns false — without invoking source, which typically opens a subscription — when the key is already attached or the group is closed. Safe before the group has a consumer: the factory runs when the group first starts.

Parameters

string
required
StreamGroupSource<T>
required

Returns

boolean

close()

Returns

Promise<void>

has()

Parameters

string
required

Returns

boolean

keys()

Attached keys, in attach order.

Returns

string[]

remove()

Detach key and close its source. Resolves once that source’s own close() settles; it deliberately does not wait on the member’s worker, which unparks only when the group’s consumer pulls. Returns false when the key was not attached.

Parameters

string
required

Returns

Promise<boolean>