pub struct Sequencer { /* private fields */ }Expand description
Owns the single writer thread; the only component allowed to append to
the repo’s OpLog.
Implementations§
Source§impl Sequencer
impl Sequencer
Sourcepub fn spawn(log: Box<dyn OpLog>) -> Self
pub fn spawn(log: Box<dyn OpLog>) -> Self
Starts the writer thread over log with the AdmitAll policy.
Sourcepub fn spawn_with_policy(
log: Box<dyn OpLog>,
policy: Box<dyn SubmitPolicy>,
) -> Self
pub fn spawn_with_policy( log: Box<dyn OpLog>, policy: Box<dyn SubmitPolicy>, ) -> Self
Starts the writer thread over log; every submission passes
through policy before it is ordered.
Records nothing. Use Sequencer::spawn_with_journal to observe
decisions.
Sourcepub fn spawn_with_journal(
log: Box<dyn OpLog>,
policy: Box<dyn SubmitPolicy>,
journal: Box<dyn Journal>,
) -> Self
pub fn spawn_with_journal( log: Box<dyn OpLog>, policy: Box<dyn SubmitPolicy>, journal: Box<dyn Journal>, ) -> Self
Sequencer::spawn_with_policy, recording every decision to
journal.
The journal is derived data: it is written after the decision is
made, never consulted, and its failure cannot refuse an op. See
journal for why the I/O belongs on another thread.
Sourcepub fn lag(&self) -> Arc<LagMeter>
pub fn lag(&self) -> Arc<LagMeter>
The writer’s latency record, for a daemon that wants to know whether the decision-latency gate is being met by the traffic it is actually serving rather than by the test suite.
Sourcepub fn handle(&self) -> SequencerHandle
pub fn handle(&self) -> SequencerHandle
Creates a new client handle for a workspace.