ReadonlylockedThe locked read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.
The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
Optionalreason: anyReturns a promise for the next caught-up state. Resolves immediately if the session is already caught up. Remains pending across reconnects. Call again after the session falls behind. Continue reading records while the promise is pending.
Resolves with the tail captured for that state.
Rejects with the read error or SESSION_CLOSED if the session ends first.
The getReader() method of the ReadableStream interface creates a reader and locks the stream to it.
Optionaloptions: ReadableStreamGetReaderOptionsReports whether the session has read through its latest reported tail. Returns false while records remain before the reported tail, after a batch without a tail, or after a reconnect. Ignored command records count toward progress. Use S2Stream.checkTail for the current stream tail.
Returns the latest tail reported for this session. This does not mean the session has read through that tail.
Get the next read position, if known.
This is the position of the next record the session expects: one past the last record delivered, or the reported tail once an empty batch shows the session is caught up. A reconnect resumes from here.
The pipeThrough() method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
Optionaloptions: StreamPipeOptionsThe pipeTo() method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
Optionaloptions: StreamPipeOptionsThe tee() method of the two-element array containing the two resulting branches as new ReadableStream instances.
Public-facing read session interface.
Yields records directly (as an async iterable or
ReadableStream) and translates transport errors into thrown exceptions. Track progress using ReadSession.nextReadPosition / ReadSession.lastObservedTail.Example