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

x/easyts/mod.ts>Chan#tryWrite

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

Attempt to write a value to the channel

Parameters

val: T

value to write

optional
exception: boolean

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

Returns

boolean

Returns true if the write is successful