pub trait Sequencer {
type Barrier: SequenceBarrier;
// Required methods
fn add_gating_sequence(&mut self, gating_sequence: &Arc<AtomicSequence>);
fn remove_gating_sequence(&mut self, sequence: &Arc<AtomicSequence>) -> bool;
fn create_sequence_barrier(
&self,
gating_sequences: &[Arc<AtomicSequence>],
) -> Self::Barrier;
fn get_cursor(&self) -> Arc<AtomicSequence>;
fn next(&mut self, n: Sequence) -> (Sequence, Sequence);
fn publish(&self, low: Sequence, high: Sequence);
fn drain(self);
}Expand description
Manages sequence generation and coordination in the ring buffer.
The sequencer is responsible for generating new sequence numbers and managing the relationship between publishers and subscribers.
§Type Parameters
Barrier- The type of sequence barrier used by this sequencer
§Methods
add_gating_sequence- Adds a gating sequence to the sequencerremove_gating_sequence- Removes a gating sequence from the sequencercreate_sequence_barrier- Creates a sequence barrier with the given gating sequencesget_cursor- Returns the current cursor valuenext- Gets the next sequence valuepublish- Publishes the given sequence rangedrain- Drains the sequencer