Expand description
Dedicated writer for the event store.
The writer owns a single backend instance and exposes a thread-safe submit entry
point. Captured entries enter via a bounded std::sync::mpsc::sync_channel and the
writer thread drains them into batched, atomic append_batch commits. The
high-watermark only advances on durable acknowledgement; a stalled submit or a
backend-side disk/corruption failure fires the registered halt callback.
Under cfg(madsim) the writer drops the channel and the dedicated thread, mirroring
the logger’s simulation pattern: submits commit synchronously on the calling thread so
tests assert against an authoritative in-process log without thread scheduling.
Re-exports§
pub use halt::HaltCallback;pub use halt::HaltReason;pub use halt::noop_halt;
Modules§
- halt
- Fail-stop signaling for the event store writer.
Structs§
- Entry
Draft - An unsealed entry handed to
EventStoreWriter::submit. - Event
Store Writer - The dedicated event store writer.
- Writer
Config - Configuration knobs for the writer.
Enums§
- Submit
Error - Errors returned by
EventStoreWriter::submit.
Constants§
- DEFAULT_
CHANNEL_ CAPACITY - Default channel capacity for entries pending the writer thread.
- DEFAULT_
HALT_ THRESHOLD - Default submit-side stall ceiling that fires the halt callback.
- DEFAULT_
MAX_ BATCH_ ENTRIES - Default maximum number of entries collected before forcing a commit.
- DEFAULT_
MAX_ BATCH_ LATENCY - Default maximum time a batch may accumulate before forcing a commit.