Dex TypeScript SDK 1.28.1
    Preparing search index...

    Class Stream<T>

    Defines a typed, best-effort resumable message stream owned by one Flow type.

    Type Parameters

    • T

      Message type encoded by the Stream codec.

    Index

    Constructors

    • Creates a Stream definition for a PersistenceSchema.

      Type Parameters

      • T

      Parameters

      • name: string

        Non-empty logical name unique within the Flow.

      • codec: Codec<T>

        Codec used for every Stream message.

      • streamCapacityBytes: number

        Positive approximate byte budget shared by this Flow type's instances.

      Returns Stream<T>

    Properties

    codec: Codec<T>

    Codec used for every Stream message.

    name: string

    Non-empty logical name unique within the Flow.

    streamCapacityBytes: number

    Positive approximate byte budget shared by this Flow type's instances.

    Methods

    • Creates an invocation-managed text writer for an asynchronous Step.

      The writer concatenates chunks exactly and flushes on its timer, soft UTF-8 size threshold, or handler completion. The Worker flushes every remaining batch before the final result or error. Empty chunks are ignored.

      Parameters

      • this: Stream<string>

        String Stream that receives each emitted batch.

      • context: Context

        Current asynchronous Step Context.

      • options: BufferedTextStreamOptions = {}

        Optional flush interval and soft byte threshold.

      Returns BufferedTextStream

      A writer whose bound BufferedTextStream.write method can be used as a callback.

      TypeError if this is not a string Stream or the Context is not an active Step.

      RangeError if an option is not a positive finite number.

    • Appends one message immediately from the current Step execution.

      The write emits a fire-and-forget frame on the current Worker response stream. One Step method invocation may write any number of messages to the same or different Streams. Dex Stream Store failures are not returned to the handler; local validation and encoding errors still throw.

      Parameters

      • context: Context

        Current Step Context; RPC Contexts are rejected.

      • value: T

        Typed message to append.

      Returns void