Interface ChannelProtocol<ValueType, UpdateType, CheckpointType>

interface ChannelProtocol<ValueType, UpdateType, CheckpointType> {
    UpdateType: UpdateType;
    ValueType: ValueType;
    lc_graph_name: string;
    checkpoint(): undefined | CheckpointType;
    fromCheckpoint(checkpoint?): this;
    get(): ValueType;
    update(values): void;
}

Type Parameters

  • ValueType = unknown
  • UpdateType = unknown
  • CheckpointType = unknown

Properties

UpdateType: UpdateType
ValueType: ValueType
lc_graph_name: string

The name of the channel.

Methods

  • Return a string representation of the channel's current state.

    Returns undefined | CheckpointType

    Throws

    if the channel is empty (never updated yet), or doesn't support checkpoints.

  • Return a new identical channel, optionally initialized from a checkpoint. Can be thought of as a "restoration" from a checkpoint which is a "snapshot" of the channel's state.

    Parameters

    Returns this

  • Return the current value of the channel.

    Returns ValueType

    Throws

    if the channel is empty (never updated yet).

  • Update the channel's value with the given sequence of updates. The order of the updates in the sequence is arbitrary.

    Parameters

    Returns void

    Throws

    if the sequence of updates is invalid.