Genkit JS API reference
    Preparing search index...

    Class InMemoryStreamManager

    An in-memory implementation of StreamManager. Useful for testing or single-instance deployments where persistence is not required.

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • Optionaloptions: { ttlSeconds?: number }

        Configuration options.

        • OptionalttlSeconds?: number

          Time-to-live for streams in seconds. Defaults to 5 minutes.

      Returns InMemoryStreamManager

    Methods

    • Opens a stream for writing.

      Type Parameters

      • S
      • O

      Parameters

      • streamId: string

        The unique identifier for the stream.

      Returns Promise<ActionStreamInput<S, O>>

      An object to write to the stream.

    • Subscribes to a stream to receive its events.

      Type Parameters

      • S
      • O

      Parameters

      • streamId: string

        The unique identifier for the stream.

      • subscriber: ActionStreamSubscriber<S, O>

        The subscriber callbacks.

      Returns Promise<{ unsubscribe: () => void }>

      A promise resolving to an object containing an unsubscribe function.