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

x/ayonli_jsext/chan.ts>Channel#send

A JavaScript extension package for building strong and modern applications.
Latest
method Channel.prototype.send
import { Channel } from "https://deno.land/x/ayonli_jsext@v0.9.72/chan.ts";

Pushes data to the channel.

If there is a receiver, the data will be consumed immediately. Otherwise:

  • If this is an non-buffered channel, this function will block until a receiver is available and the data is consumed.

  • If this is a buffered channel, then:

    • If the buffer size is within the capacity, the data will be pushed to the buffer.
    • Otherwise, this function will block until there is new space for the data in the buffer.

Parameters

data: T

Returns

Promise<void>