Dex TypeScript SDK 1.29.0
    Preparing search index...

    Class ChannelMap<T>

    Defines keyed Channel instances that share one typed schema. Instance keys must be non-empty and must not contain /.

    Type Parameters

    • T

      Type of every published value.

    Index

    Constructors

    • Creates a ChannelMap definition.

      Type Parameters

      • T

      Parameters

      • name: string

        Non-empty name without /, unique within the Flow.

      • codec: Codec<T>

        Element codec shared by every instance.

      Returns ChannelMap<T>

    Properties

    codec: Codec<T>

    Element codec shared by every instance.

    name: string

    Non-empty name without /, unique within the Flow.

    Methods

    • Creates an instance condition requiring at least count values.

      Parameters

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      • count: number

        Inclusive non-negative lower bound.

      • OptionalconditionId: string

        Optional stable condition identifier.

      Returns Condition

      A condition without an upper bound.

    • Creates a non-blocking instance condition consuming up to count queued values. When its surrounding Wait completes, it consumes values queued then; an empty queue yields none.

      Parameters

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      • count: number

        Inclusive non-negative upper bound.

      • OptionalconditionId: string

        Optional stable condition identifier.

      Returns Condition

      A condition without a positive lower bound.

    • Stages best-effort deletion of one pending message from a ChannelMap instance.

      Parameters

      • context: Context

        Current Step, timeout-handler, or RPC Context.

      • instance: string

        The ChannelMap instance. Slash is prohibited because it is a reserved character.

      • messageId: string

        Non-empty server-assigned message ID.

      Returns void

    • Finds one instance message in the loaded pending snapshot.

      Parameters

      • context: Context

        Current Step, timeout-handler, or RPC Context.

      • instance: string

        Logical ChannelMap instance.

      • messageId: string

        Server-assigned message ID.

      Returns ChannelMessage<T> | undefined

      The matching message, or undefined when absent from the snapshot.

    • Creates an instance condition consuming exactly count values.

      Parameters

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      • count: number

        Required non-negative count.

      • OptionalconditionId: string

        Optional stable condition identifier.

      Returns Condition

      A condition with equal bounds.

    • Creates an instance condition consuming exactly one value.

      Parameters

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      • OptionalconditionId: string

        Optional stable condition identifier.

      Returns Condition

      An exact-one instance condition.

    • Returns decoded non-empty instance keys in ascending order.

      Parameters

      • context: Context

        Current Step, timeout-handler, or RPC Context.

      Returns readonly string[]

      Keys including publications buffered by the current handler.

    • Returns the number of non-empty instances visible to the current handler.

      Parameters

      • context: Context

        Current Step, timeout-handler, or RPC Context.

      Returns number

      The number of keys after including publications buffered by this handler.

    • Selects one instance's pending messages for a handler snapshot.

      Parameters

      • instance: string

        Non-empty logical instance key. The SDK escapes it for the protocol.

      Returns ChannelMapLoad

      An exact instance load for RPC, Step, or timeout-handler options.

    • Returns one loaded instance snapshot in FIFO order.

      Parameters

      • context: Context

        Current Step, timeout-handler, or RPC Context.

      • instance: string

        Logical ChannelMap instance.

      Returns readonly ChannelMessage<T>[]

      Immutable pending message IDs and decoded values.

      ChannelMessagesNotLoadedError when this handler did not load the instance's messages.

    • Stages one value for a ChannelMap instance.

      Parameters

      • context: Context

        Current Step or RPC Context.

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      • value: T

        Typed value to append.

      Returns void

    • Creates a bounded condition for one ChannelMap instance. Dex waits only for atLeast, then consumes currently queued values up to atMost. Omitting atLeast makes the condition complete immediately.

      Parameters

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      • OptionalatLeast: number

        Optional inclusive lower bound.

      • OptionalatMost: number

        Optional inclusive upper bound.

      • OptionalconditionId: string

        Optional stable condition identifier.

      Returns Condition

      A validated instance condition.

    • Returns values selected for one instance by the satisfied condition.

      Parameters

      • context: Context

        Current Step Context.

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      Returns readonly T[]

      Ordered values for this Step execution.

    • Returns one instance's queued value count.

      Parameters

      • context: Context

        Current Step or RPC Context.

      • instance: string

        The map instance. Slash is prohibited because it is a reserved character.

      Returns number

      Non-negative queued value count.