@s2-dev/streamstore - v0.18.1
    Preparing search index...

    Interface ReadSession<Format>

    Public-facing read session interface. Yields records directly and propagates errors by throwing (standard stream behavior).

    interface ReadSession<Format extends "string" | "bytes" = "string"> {
        locked: boolean;
        "[asyncDispose]"(): PromiseLike<void>;
        "[asyncIterator]"(): AsyncIterator<ReadRecord<Format>, any, any>;
        cancel(reason?: any): Promise<void>;
        getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
        getReader(): ReadableStreamDefaultReader<ReadRecord<Format>>;
        getReader(
            options?: ReadableStreamGetReaderOptions,
        ): ReadableStreamReader<ReadRecord<Format>>;
        lastObservedTail(): StreamPosition;
        nextReadPosition(): StreamPosition;
        pipeThrough<T>(
            transform: ReadableWritablePair<T, ReadRecord<Format>>,
            options?: StreamPipeOptions,
        ): ReadableStream<T>;
        pipeTo(
            destination: WritableStream<ReadRecord<Format>>,
            options?: StreamPipeOptions,
        ): Promise<void>;
        tee(): [
            ReadableStream<ReadRecord<Format>>,
            ReadableStream<ReadRecord<Format>>,
        ];
    }

    Type Parameters

    • Format extends "string" | "bytes" = "string"

    Hierarchy

    Index

    Properties

    locked: boolean

    Methods

    • Returns PromiseLike<void>

    • Returns AsyncIterator<ReadRecord<Format>, any, any>

    • Parameters

      • Optionalreason: any

      Returns Promise<void>

    • Parameters

      • options: { mode: "byob" }

      Returns ReadableStreamBYOBReader

    • Returns ReadableStreamDefaultReader<ReadRecord<Format>>

    • Parameters

      • Optionaloptions: ReadableStreamGetReaderOptions

      Returns ReadableStreamReader<ReadRecord<Format>>

    • Type Parameters

      • T

      Parameters

      • transform: ReadableWritablePair<T, ReadRecord<Format>>
      • Optionaloptions: StreamPipeOptions

      Returns ReadableStream<T>

    • Parameters

      • destination: WritableStream<ReadRecord<Format>>
      • Optionaloptions: StreamPipeOptions

      Returns Promise<void>