Skip to main content

Module writer

Module writer 

Source
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§

EntryDraft
An unsealed entry handed to EventStoreWriter::submit.
EventStoreWriter
The dedicated event store writer.
WriterConfig
Configuration knobs for the writer.

Enums§

SubmitError
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.