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

x/easyts/channel.ts>Chan#write

js library written with ts, use select and chan like golang in js.
Latest
method Chan.prototype.write
import { Chan } from "https://deno.land/x/easyts@0.1.3/channel.ts";

Writes a value to the channel, blocking if the channel is not writable until the channel is writable or closed

Parameters

val: T

value to write

optional
exception: boolean

If set to true, writing to a closed channel will throw an exception

Returns

boolean | Promise<boolean>

Returns true if the write is successful, false otherwise this is usually because the channel has been closed