pub struct Sequencer { /* private fields */ }Expand description
Used by sender to track the message sequence numbers it sends to each destination. Each Sequencer object has a session id, sequence numbers are scoped by the (session_id, SeqKey) pair.
Implementations§
Source§impl Sequencer
impl Sequencer
Sourcepub fn assign_seq(&self, port_id: &PortAddr) -> SeqInfo
pub fn assign_seq(&self, port_id: &PortAddr) -> SeqInfo
Assign the next seq for a port, mutate the sequencer with the new seq, and return the new seq.
- Handler ports: share the same sequence scheme per actor (keyed by ActorAddr).
- Ephemeral ports: get individual sequence schemes (keyed by PortAddr).
- Control ports: bypass receive-side reordering and use
SeqInfo::Direct.
Sourcepub fn last_sent_to_actor(&self, actor: &ActorAddr) -> u64
pub fn last_sent_to_actor(&self, actor: &ActorAddr) -> u64
Last sequence sent to any handler port on actor.
Sourcepub fn assign_seqs(&self, keys: &[SeqKey]) -> Vec<(Range<usize>, u64)>
pub fn assign_seqs(&self, keys: &[SeqKey]) -> Vec<(Range<usize>, u64)>
Assign the next sequence number to each key.
This assigns the same sequence numbers, in the same order, as calling
Self::assign_seq for each equivalent destination. Each occurrence
of a repeated key advances its sequence number.
The result is run-length encoded. Each (range, seq) assigns seq to
the input indexes in range. The ordered ranges cover 0..keys.len()
without gaps. An empty input returns an empty result.
Sourcepub fn session_id(&self) -> Uuid
pub fn session_id(&self) -> Uuid
Id of the session this sequencer belongs to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sequencer
impl RefUnwindSafe for Sequencer
impl Send for Sequencer
impl Sync for Sequencer
impl Unpin for Sequencer
impl UnsafeUnpin for Sequencer
impl UnwindSafe for Sequencer
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].