Skip to main content

Module adapter

Module adapter 

Source
Expand description

The bus capture adapter.

BusCaptureAdapter is the seam between the message bus and the EventStoreWriter. The kernel calls BusCaptureAdapter::capture inside its bus dispatch wrappers, immediately before the message reaches downstream handlers, so every captured entry is durably submitted before a subscriber observes it. The adapter consults the EncoderRegistry allow-list to decide whether to capture, and converts the typed message into an EntryDraft for the writer.

No-drop contract: any SubmitError from the writer fires the adapter’s halt callback exactly once (so kernel fail-stop runs even when the writer’s own halt path has not, such as when a caller closes the writer externally) and surfaces as CaptureError::Submit. Subsequent capture calls short-circuit with CaptureError::Halted without re-entering the writer.

Under cfg(madsim) the writer’s submit is a synchronous in-thread commit, so the adapter exposes the same surface and no thread-scheduling differences leak into tests.

Structs§

BusCaptureAdapter
Captures bus traffic and forwards encoded entries to the EventStoreWriter.

Enums§

CaptureError
Errors returned by BusCaptureAdapter::capture.