Skip to main content
Module

x/effection/mod.ts>Channel

Structured concurrency and effects for JavaScript
Latest
interface Channel
implements Stream<T, TClose>
import { type Channel } from "https://deno.land/x/effection@3.0.3/mod.ts";

A broadcast channel that multiple consumers can subscribe to the via the same Stream, and messages sent to the channel are received by all consumers. The channel is not buffered, so if there are no consumers, the message is dropped.

Methods

send(message: T): Operation<void>

Send a message to all subscribers of this Channel

close(value: TClose): Operation<void>

End every subscription to this Channel