Interface ReadChannel<T>

a read-only channel

Type Parameters

  • T

Hierarchy

Implemented by

Properties

capacity: number

Returns how much data the channel has buffered

isClosed: boolean

Returns whether the channel is closed

length: number

Returns the channel buffer size

Methods

  • Implement asynchronous iterators

    Returns AsyncGenerator<T, any, unknown>

  • Read a value from the channel, block if there is no value to read, and return until there is a value or the channel is closed

    Returns ReadReturn<T>

  • Attempts to read a value from the channel, returns undefined if no value is readable, returns {done:true} if the channel is closed

    Returns undefined | IteratorResult<T, any>

  • Wait for chan to close, no data will be read from chan

    Returns undefined | Promise<void>

Generated using TypeDoc