A11 TypeScript API - v0.2.1
    Preparing search index...

    Class ChunkStoreWriter

    Bounded, batched, stackless writer over a ChunkStore.

    Producers enqueue chunks in logical sequence order. Await admitted to respect queue backpressure and confirmation to know storage accepted the fragment. The writer also calls send on attached wire streams; that call confirms local transport admission, not delivery by the remote agent.

    A final write fixes the logical end of the sequence. Lifecycle methods then either drain and seal storage, propagate an error, or cancel immediately.

    Index
    options: Readonly<NormalizedWriterOptions>
    store: ChunkStore
    • get queueSize(): number

      Number of admitted and backpressured chunks still awaiting completion.

      Returns number

    • Flush queued chunks and close the backing store to further writes.

      This does not append a final fragment. Mark the last write final (or use AsyncNode.putNullFinal) before draining when readers need a final sequence number to identify the logical end of the stream.

      Returns Promise<Status>

    • Enqueue a chunk and expose admission and persistence as separate promises.

      Parameters

      • chunk: Chunk
      • seq: number | null = null
      • final: boolean = false
      • ensureStarted: boolean = true

      Returns ChunkStoreWrite

    • Apply backpressure, persist a chunk, and return its confirmed sequence.

      Parameters

      • chunk: Chunk
      • seq: number | null = null
      • final: boolean = false

      Returns Promise<StatusOr<number>>