pub struct Cluster { /* private fields */ }Expand description
Central Actor for cluster handling
Implementations§
Source§impl Cluster
impl Cluster
pub fn new(ip_address: SocketAddr, seed_nodes: Vec<SocketAddr>) -> Addr<Cluster>
pub fn new_with_connection_protocol( ip_address: SocketAddr, seed_nodes: Vec<SocketAddr>, connection_protocol: ConnectionProtocol, ) -> Addr<Cluster>
Trait Implementations§
Source§impl Actor for Cluster
impl Actor for Cluster
Source§fn started(&mut self, ctx: &mut Self::Context)
fn started(&mut self, ctx: &mut Self::Context)
Called when an actor gets polled the first time.
Source§fn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
Called after an actor is in
Actor::Stopping state. Read moreSource§fn start_default() -> Addr<Self>
fn start_default() -> Addr<Self>
Construct and start a new asynchronous actor, returning its
address. Read more
Source§fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
Start new actor in arbiter’s thread.
Source§impl CustomSystemService for Cluster
impl CustomSystemService for Cluster
Source§fn start_service_with(
f: impl Fn() -> Self + Sync + 'static + Send,
) -> Addr<Self>
fn start_service_with( f: impl Fn() -> Self + Sync + 'static + Send, ) -> Addr<Self>
Construct and start system service with arguments
fn custom_service_started(&mut self, ctx: &mut Context<Self>)
fn add_to_registry(addr: Addr<Self>) -> Addr<Self>
Source§fn from_custom_registry() -> Addr<Self>
fn from_custom_registry() -> Addr<Self>
Get actor’s address from system registry
Source§impl Handler<ConnectToNode> for Cluster
impl Handler<ConnectToNode> for Cluster
Source§impl Handler<ConnectionApproval> for Cluster
impl Handler<ConnectionApproval> for Cluster
Source§type Result = ConnectionApprovalResponse
type Result = ConnectionApprovalResponse
The type of value that this handler will return. Read more
Source§fn handle(
&mut self,
msg: ConnectionApproval,
_ctx: &mut Self::Context,
) -> ConnectionApprovalResponse
fn handle( &mut self, msg: ConnectionApproval, _ctx: &mut Self::Context, ) -> ConnectionApprovalResponse
This method is called for every message received by this actor.
Source§impl Handler<TcpConnect> for Cluster
impl Handler<TcpConnect> for Cluster
Source§impl Supervised for Cluster
impl Supervised for Cluster
Source§fn restarting(&mut self, ctx: &mut Self::Context)
fn restarting(&mut self, ctx: &mut Self::Context)
Called when the supervisor restarts a failed actor.
Source§impl SystemService for Cluster
impl SystemService for Cluster
Source§fn start_service(wrk: &ArbiterHandle) -> Addr<Self>
fn start_service(wrk: &ArbiterHandle) -> Addr<Self>
Construct and start system service
Source§fn service_started(&mut self, ctx: &mut Context<Self>)
fn service_started(&mut self, ctx: &mut Context<Self>)
Method is called during service initialization.
Source§fn from_registry() -> Addr<Self>
fn from_registry() -> Addr<Self>
Get actor’s address from system registry
Auto Trait Implementations§
impl Freeze for Cluster
impl !RefUnwindSafe for Cluster
impl Send for Cluster
impl Sync for Cluster
impl Unpin for Cluster
impl UnsafeUnpin for Cluster
impl !UnwindSafe for Cluster
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
Source§impl<A> BrokerIssue for A
impl<A> BrokerIssue for A
Source§fn issue_async<T, M>(&self, msg: M)where
T: RegisteredBroker,
M: BrokerMsg,
fn issue_async<T, M>(&self, msg: M)where
T: RegisteredBroker,
M: BrokerMsg,
Asynchronously issue a message.
This bypasses the mailbox capacity, and will always queue the message.
If the mailbox is closed, the message is silently dropped and the subscriber
is detached from the broker.
Source§fn issue_sync<T, M>(&self, msg: M, ctx: &mut Self::Context)where
T: RegisteredBroker,
M: BrokerMsg,
fn issue_sync<T, M>(&self, msg: M, ctx: &mut Self::Context)where
T: RegisteredBroker,
M: BrokerMsg,
Synchronously issue a message.
This also causes the broker to synchronously forward those messages on to any subscribers
before handling any other messages.
Source§fn issue_system_async<M>(&self, msg: M)where
M: BrokerMsg,
fn issue_system_async<M>(&self, msg: M)where
M: BrokerMsg,
Helper to asynchronously issue to an system broker
This is the equivalent of
self.issue_async::<SystemBroker, M>(ctx);Source§fn issue_system_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
fn issue_system_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
Helper to synchronously issue to an system broker
This is the equivalent of
self.issue_sync::<SystemBroker, M>(ctx);Source§fn issue_arbiter_async<M>(&self, msg: M)where
M: BrokerMsg,
fn issue_arbiter_async<M>(&self, msg: M)where
M: BrokerMsg,
Helper to asynchronously issue to an arbiter-specific broker
This is the equivalent of
self.issue_async::<ArbiterBroker, M>(ctx);Source§fn issue_arbiter_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
fn issue_arbiter_sync<M>(&self, msg: M, ctx: &mut Self::Context)where
M: BrokerMsg,
Helper to synchronously issue to an arbiter-specific broker
This is the equivalent of
self.issue_sync::<ArbiterBroker, M>(ctx);Source§impl<A> BrokerSubscribe for A
impl<A> BrokerSubscribe for A
Source§fn subscribe_async<T, M>(&self, ctx: &mut Self::Context)
fn subscribe_async<T, M>(&self, ctx: &mut Self::Context)
Asynchronously subscribe to a message.
Source§fn subscribe_sync<T, M>(&self, ctx: &mut Self::Context)
fn subscribe_sync<T, M>(&self, ctx: &mut Self::Context)
Synchronously subscribe to a message.
This actor will do nothing else until its interest is registered.
If messages of that type have been sent to the broker previously, a copy of the latest
message is sent to the calling actor after it has subscribed.
Source§fn subscribe_system_async<M>(&self, ctx: &mut Self::Context)
fn subscribe_system_async<M>(&self, ctx: &mut Self::Context)
Helper to asynchronously subscribe to a system broker
This is the equivalent of
self.subscribe_async::<SystemBroker, M>(ctx);Source§fn subscribe_system_sync<M>(&self, ctx: &mut Self::Context)
fn subscribe_system_sync<M>(&self, ctx: &mut Self::Context)
Helper to synchronously subscribe to a system broker
This is the equivalent of `self.subscribe_sync::<SystemBroker, M>(ctx);
Source§fn subscribe_arbiter_async<M>(&self, ctx: &mut Self::Context)
fn subscribe_arbiter_async<M>(&self, ctx: &mut Self::Context)
Helper to asynchronously subscribe to an arbiter-specific broker
This is the equivalent of
self.subscribe_async::<ArbiterBroker, M>(ctx);Source§fn subscribe_arbiter_sync<M>(&self, ctx: &mut Self::Context)
fn subscribe_arbiter_sync<M>(&self, ctx: &mut Self::Context)
Helper to synchronously subscribe to an arbiter-specific broker
This is the equivalent of `self.subscribe_sync::<ArbiterBroker, M>(ctx);