pub enum Barrier {
Centralized(LinearBarrier),
BinaryTree(BinaryTreeBarrier),
Dissemination(DisseminationBarrier),
}Expand description
A connected barrier ready to synchronize with peers.
Normally accessed through Node::barrier rather
than directly.
§Peer list contract
Both barrier and barrier_unchecked
require the peer list to obey the following rules (only barrier
validates them):
- Sorted — ranks must appear in strictly ascending order.
- No duplicates — each rank may appear at most once.
- Self included — this node’s own rank must be present.
§Poisoning
If any call returns an error, the barrier is permanently poisoned and all
subsequent calls return BarrierError::Poisoned immediately. Recreate the
Node to recover.
Variants§
Centralized(LinearBarrier)
Leader-based barrier. See BarrierAlgorithm::Centralized.
BinaryTree(BinaryTreeBarrier)
Binary-tree barrier. See BarrierAlgorithm::BinaryTree.
Dissemination(DisseminationBarrier)
Dissemination barrier. See BarrierAlgorithm::Dissemination.
Implementations§
Source§impl Barrier
impl Barrier
Sourcepub fn barrier(
&mut self,
multi_channel: &mut MultiChannel,
peers: &[usize],
timeout: Duration,
) -> Result<(), BarrierError>
pub fn barrier( &mut self, multi_channel: &mut MultiChannel, peers: &[usize], timeout: Duration, ) -> Result<(), BarrierError>
Synchronizes with the given peers, blocking until all have reached the barrier or timeout.
Sourcepub fn barrier_unchecked(
&mut self,
multi_channel: &mut MultiChannel,
peers: &[usize],
timeout: Duration,
) -> Result<(), BarrierError>
pub fn barrier_unchecked( &mut self, multi_channel: &mut MultiChannel, peers: &[usize], timeout: Duration, ) -> Result<(), BarrierError>
Like barrier, but skips validation of the peer list.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Barrier
impl RefUnwindSafe for Barrier
impl Send for Barrier
impl Sync for Barrier
impl Unpin for Barrier
impl UnsafeUnpin for Barrier
impl UnwindSafe for Barrier
Blanket Implementations§
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
Mutably borrows from an owned value. Read more