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

x/easyts/mod.ts>WriteCase

js library written with ts, use select and chan like golang in js.
Latest
class WriteCase
implements WriteCaseLike
import { WriteCase } from "https://deno.land/x/easyts@0.1.3/mod.ts";

Constructors

new
private
WriteCase(
ch: Chan<T>,
val: T,
exception?: boolean,
)

Properties

private
optional
write_: boolean
readonly
isReady: boolean

Returns whether this case is ready

Methods

do(resolve: (c: CaseLike) => void, reject: (c: CaseLike) => void): Connection
invoke(): Promise<void>

reset read-write status

tryInvoke(): boolean
write(): boolean

Returns whether the case was written successfully, throws an exception if the case is not ready or this is not a write case

Static Methods

make<T>(
ch: Chan<T>,
val: T,
exception?: boolean,
): WriteCase<T>