Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ChannelWrapperImp<T>

Type parameters

  • T

Hierarchy

  • ChannelWrapperImp

Implements

Index

Constructors

constructor

Properties

Private __ch__

__ch__: Channel<T>

A reference to the real Channel that is wrapped

Methods

__@asyncIterator

  • __@asyncIterator(): AsyncIterableIterator<T>
  • Dear, old generators delegation :)

    Returns AsyncIterableIterator<T>

drain

  • drain(): Promise<T[]>

getInnerChannel

put

  • put(msg: T): Promise<void>

take

  • take(): Promise<T>

Static alts

  • The alts static method will race taking values from multiple channels. It will perform a conversion between ChannelWrapper and the Channels needed by the alts async function

    Type parameters

    • S

    Parameters

    Returns Promise<S>

Static merge

  • The merge static method will merge together multiple channels, returning a new one that will receive each value inserted into one of its input channels. As soon as a value is available from one of the input channels, it will be putted into the resulting channel.

    Type parameters

    • S

    Parameters

    Returns ChannelWrapper<S>

    A fresh new channel that will receive all the values inserted into input channels

Static mergeDelayed

  • The mergeDelayed static method will merge together multiple channels, returning a new one that will receive each value inserted into one of its input channels. Before taking the next value from one of the input channels, a corresponding take operation will be waited (implicitly contained into the drain method).

    Type parameters

    • S

    Parameters

    Returns ChannelWrapper<S>

    A fresh new channel that will receive all the values inserted into input channels

Static select

  • The select static method will race taking values from multiple channels, similar to alts, but will also return the key of the channel that was selected. It will perform a conversion between ChannelWrapper and the Channels needed by select

    Type parameters

    • S

    Parameters

    Returns Promise<[any, S]>

Generated using TypeDoc