pub struct ClusterNode { /* private fields */ }Expand description
Running Datum cluster membership node.
Implementations§
Source§impl ClusterNode
impl ClusterNode
Sourcepub async fn start(config: ClusterConfig) -> ClusterResult<Self>
pub async fn start(config: ClusterConfig) -> ClusterResult<Self>
Start a cluster node with TimeoutDowning using
ClusterConfig::downing_timeout.
Sourcepub async fn start_with_downing(
config: ClusterConfig,
downing: Arc<dyn DowningProvider>,
) -> ClusterResult<Self>
pub async fn start_with_downing( config: ClusterConfig, downing: Arc<dyn DowningProvider>, ) -> ClusterResult<Self>
Start a cluster node with a custom downing provider.
Sourcepub const fn local_addr(&self) -> SocketAddr
pub const fn local_addr(&self) -> SocketAddr
Local UDP address bound by the node.
Sourcepub const fn advertise_addr(&self) -> SocketAddr
pub const fn advertise_addr(&self) -> SocketAddr
Address advertised to peers.
Sourcepub fn state(&self) -> Signal<ClusterState>
pub fn state(&self) -> Signal<ClusterState>
Current-state feed.
Sourcepub fn events(&self) -> Subscription<MemberEvent>
pub fn events(&self) -> Subscription<MemberEvent>
Lossless membership event feed.
Sourcepub fn current_state(&self) -> Arc<ClusterState>
pub fn current_state(&self) -> Arc<ClusterState>
Current immutable membership snapshot.
Sourcepub async fn leave(&self) -> ClusterResult<()>
pub async fn leave(&self) -> ClusterResult<()>
Gracefully leave the cluster.
Sourcepub async fn abort(&self) -> ClusterResult<()>
pub async fn abort(&self) -> ClusterResult<()>
Stop this node without sending a graceful leave. This is useful for crash/failure tests.
Sourcepub async fn shutdown(&self) -> ClusterResult<()>
pub async fn shutdown(&self) -> ClusterResult<()>
Alias for ClusterNode::abort.
Trait Implementations§
Source§impl Drop for ClusterNode
impl Drop for ClusterNode
Auto Trait Implementations§
impl Freeze for ClusterNode
impl RefUnwindSafe for ClusterNode
impl Send for ClusterNode
impl Sync for ClusterNode
impl Unpin for ClusterNode
impl UnsafeUnpin for ClusterNode
impl UnwindSafe for ClusterNode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage