Skip to content

Packages  ›  trotsky  ›  StepBuilderStream

StepBuilderStream class ​

Abstract class representing a step for streaming messages using a Jetstream event emitter.

Signature:

typescript
export declare abstract class StepBuilderStream<P = StepBuilder, C = unknown, O = JetstreamMessage> extends Step<P, C, O>

Extends: Step<P, C, O>

Constructors ​

Constructor

Modifiers

Description

(constructor)(agent, parent)

Initializes the StepBuilderStream instance with the given agent and parent step.

Properties ​

Property

Modifiers

Type

Description

_steps

StepBuilderStreamEntry<this>[]

Holds the list of steps to be executed for each streamed entry.

Methods ​

Method

Modifiers

Description

apply()

Applies the stream logic by listening to events from the event emitter and processing them sequentially. Messages are handled using a queue to ensure sequential execution.

buildEventEmitter()

abstract

Build the Jetstream event emitter. Must be implemented by subclasses.

each()

Appends a new stream entry step to the current list and returns it.

onMessage(message)

Processes a Jetstream message by executing child steps for valid commit events.

resolveOutput(message)

Resolves the output of the current step from the given message.