This function returns a SegmentSlice from the SegmentStore(s). Individual events can be read from the Slice with the following snippets.
const seg_slice: Slice = await stream_reader.get_segment_slice();
for (const event of seg_slice) {
const raw_value: ArrayBuffer = event.data();
// do your things
}
Invoking this function multiple times ensure multiple SegmentSlices corresponding to different Segments of the stream are received. In-case we receive data for an already acquired SegmentSlice, this method waits until SegmentSlice is completely consumed before returning the data.
Slice in Promise.
Mark the reader as offline.
This will ensure the segments owned by this reader is distributed to other readers in the ReaderGroup.
Generated using TypeDoc
A reader for a stream.
Note: A StreamReader cannot be created directly without using the StreamReaderGroup.