An ordered, buffered read cursor over a ChunkStore.
More...
#include <cpp/a11/stores/chunk_store_reader.h>
An ordered, buffered read cursor over a ChunkStore.
A reader pulls data::NodeFragment values out of a store, prefetching ahead into a bounded buffer per its ChunkStoreReaderOptions. A background pump fetches fragments; callers await Next() to consume them. It is a first-class object that can be driven directly, though most code reaches one through a node. State is reference-counted and held via shared_ptr.
◆ ~ChunkStoreReader()
| a11::stores::ChunkStoreReader::~ChunkStoreReader |
( |
| ) |
|
|
default |
◆ buffer_size()
| size_t a11::stores::ChunkStoreReader::buffer_size |
( |
| ) |
const |
- Returns
- The number of prefetched fragments currently buffered.
◆ Cancel()
| void a11::stores::ChunkStoreReader::Cancel |
( |
| ) |
|
Stop the background read pump.
Pending Next() awaitables are resolved and no further fragments are fetched.
◆ Create()
Create a reader over store.
- Parameters
-
| store | The store to read fragments from. |
| options | Tuning for ordering, buffering, offset, pop-on-read behavior, and sticky-mimetype expansion. |
- Returns
- A shared, ready-to-use reader, or an error status if the options are invalid.
◆ Done()
| a11::Task a11::stores::ChunkStoreReader::Done |
( |
| ) |
const |
Await completion of the background read pump.
- Returns
- An awaitable that resolves once the reader has drained the store or been cancelled.
◆ EnsureStarted()
| void a11::stores::ChunkStoreReader::EnsureStarted |
( |
| ) |
|
Start the background read pump if it is not already running.
Reading normally starts the pump lazily; call this to begin buffering before the first Next().
◆ GetStatus()
| absl::Status a11::stores::ChunkStoreReader::GetStatus |
( |
| ) |
const |
Get the reader's current status.
- Returns
- The status distinguishing a healthy stream from one that has failed or ended.
◆ Next()
Get the next fragment from the store.
- Parameters
-
| timeout | The maximum duration to wait before giving up. |
- Returns
- An awaitable that resolves with the next fragment, or an empty optional at end of stream.
◆ options()
- Returns
- The options this reader was created with.
◆ store()
| std::shared_ptr< ChunkStore > a11::stores::ChunkStoreReader::store |
( |
| ) |
const |
- Returns
- The store this reader draws fragments from.
The documentation for this class was generated from the following files: