Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/channel/mod.ts>CrossChannel.Constructors

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface CrossChannel.Constructors
import { type CrossChannel } from "https://deno.land/x/rimbu@1.2.0/channel/mod.ts";
const { Constructors } = CrossChannel;

Defines the static CrossChannel API.

Methods

createPair<TSend = void, TReceive = TSend>(config?: CrossChannel.Config): CrossChannel.Pair<TSend, TReceive>

Returns a pair of connected CrossChannels of which the send module of the first is connected to the receive module of the second, and the send module of the second is connected to the receive module of the first.

combine<TSend = void, TReceive = TSend>(writeCh: Channel.Write<TSend>, readCh: Channel.Read<TReceive>): CrossChannel<TSend, TReceive>

Returns a CrossChannel where the send module comprises the given writeCh, and the receive module conists of the given readCh.