pub struct ClusterSingletonManager { /* private fields */ }Expand description
Decides which node hosts the singleton based on oldest up-member — a hook is provided so tests can simulate handover without wiring the full cluster.
Implementations§
Source§impl ClusterSingletonManager
impl ClusterSingletonManager
pub fn new() -> Arc<Self>
Sourcepub fn with_buffer_size(size: usize) -> Arc<Self>
pub fn with_buffer_size(size: usize) -> Arc<Self>
Construct with a custom proxy buffer size.
pub fn state(&self) -> SingletonState
Sourcepub fn set_active_here(&self, r: UntypedActorRef)
pub fn set_active_here(&self, r: UntypedActorRef)
Mark r as the local singleton (we won the election).
Flushes any messages that were buffered during handover.
Sourcepub fn set_active_remote(&self, r: UntypedActorRef)
pub fn set_active_remote(&self, r: UntypedActorRef)
Mark r as the remote singleton (some other node is hosting it).
Sourcepub fn begin_handover(&self)
pub fn begin_handover(&self)
Begin handover (we used to be Active(here)).
Sourcepub fn begin_starting(&self)
pub fn begin_starting(&self)
Begin starting (we were elected as the new oldest).
pub fn current(&self) -> Option<UntypedActorRef>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ClusterSingletonManager
impl !RefUnwindSafe for ClusterSingletonManager
impl Send for ClusterSingletonManager
impl Sync for ClusterSingletonManager
impl Unpin for ClusterSingletonManager
impl UnsafeUnpin for ClusterSingletonManager
impl !UnwindSafe for ClusterSingletonManager
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