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.
ReadableStream
const session = await stream.readSession({ start: { from: { tailOffset: 50 } }, stop: { wait: 15 },});for await (const record of session) { console.log(record.seqNum, record.body);} Copy
const session = await stream.readSession({ start: { from: { tailOffset: 50 } }, stop: { wait: 15 },});for await (const record of session) { console.log(record.seqNum, record.body);}
Readonly
MDN Reference
Optional
Get the last observed tail position, if known.
Get the next read position, if known.
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