Utils
close<T = unknown>(ch: Channel): void
Will correctly close a channel.
hasValues(ch: Channel): boolean
Will return true if channel has any values
isChannelClosedError(e: unknown): boolean
Indicates whether a value is an error thrown by closed channel.
waitForIncomingPut<C extends Channel>(ch: C): Generator<undefined, void, unknown>
Will return a generator which is done once any put request is received by the channel
waitForIncomingPutAsync: (ch: Channel) => Promise
A promise version of waitForIncomingPut
waitForIncomingTake<C extends Channel>(ch: C): Generator<undefined, void, unknown>
Will return a generator which is done once any take request is received by the channel
waitForPutQueueToRelease<C extends Channel>(ch: C): Generator<undefined, void, unknown>
Will return a generator which is done once the channel is ready to accept new incoming put requests or in other words will not block the next incoming put request.
waitForPutQueueToReleaseAsync: (ch: Channel) => Promise<void>
A promise version of waitForPutQueueToRelease
waitForTakeQueueToRelease<C extends Channel>(ch: C): Generator<undefined, void, unknown>
Will return a generator which is done once the channel is ready to accept new take requests or in other words will not block the next incoming take request.
waitUntilBufferEmpty<C extends Channel>(ch: C): Generator<undefined, void, unknown>
Will return a generator which is done once the channel has no put requests to process e.g put queue is empty.
waitUntilBufferIsEmptyAsync: (ch: Channel) => Promise<void>
Is a promise version of waitUntilBufferEmpty.
Last updated