menu

AsyncSender

import { AsyncSender } from "destack:channel";

Asynchronous sender endpoint.

language/library/src/channel/channel.ds:86:95
1export interface AsyncSender<T> {2    send(value: ^T): AsyncResult<void, SendError<T>>;3    trySend(value: ^T): Result<void, SendError<T>>;4    close(): void;5}

Members

send(value: ^T): AsyncResult<void, SendError<T>>

Send one value.

trySend(value: ^T): Result<void, SendError<T>>

Try to send one value without suspending.

close(): void

Close this sender.