disruptor 4.1.0

Low latency inter-thread communication via a ringbuffer (inspired by the LMAX Disruptor).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::Sequence;

/// Indicates no sequence number has been claimed (yet).
pub const NONE: Sequence = -1;

#[doc(hidden)]
pub trait Barrier: Send + Sync {
	/// Gets the sequence number of the barrier with relaxed memory ordering.
	/// `prev` must be the last sequence returned from this barrier.
	///
	/// Note, to establish proper happens-before relationships (and thus proper synchronization),
	/// the caller must issue a [`std::sync::atomic::fence`] with [`Ordering::Acquire`].
	fn get_after(&self, prev: Sequence) -> Sequence;
}