import { type Channel } from "https://deno.land/x/rimbu@1.1.0/channel/custom/index.ts";
const { Write } = Channel;
A write-only Channel that can perform blocking writes. This means that a send
call will block until the channel has capacity to send a
message.
Methods
writable(): Channel.Write<T>
Returns the Channel as a write-only Channel.Write instance.
send(value: T, options: { signal?: AbortSignal | undefined; timeoutMs?: number | undefined; catchChannelErrors?: false | undefined; }): Promise<void>
Send the given value
message to the Channel. Blocks if the Channel is already at maximum capacity.
send(value: T, options?: { signal?: AbortSignal | undefined; timeoutMs?: number | undefined; catchChannelErrors: boolean; }): Promise<undefined | Channel.Error>
sendAll(source: AsyncStreamSource<T>, options: { signal?: AbortSignal | undefined; timeoutMs?: number | undefined; catchChannelErrors?: false | undefined; }): Promise<void>
Sequentially send all the values in the given source
to the channel. Blocks until all the values are sent.
sendAll(source: AsyncStreamSource<T>, options?: { signal?: AbortSignal | undefined; timeoutMs?: number | undefined; catchChannelErrors: boolean; }): Promise<undefined | Channel.Error>