Enum ockam_node::NodeMessage
source · pub enum NodeMessage {
Show 13 variants
StartWorker {
addrs: Vec<Address>,
senders: SenderPair,
detached: bool,
mailbox_count: Arc<AtomicUsize>,
reply: SmallSender<NodeReplyResult>,
},
ListWorkers(SmallSender<NodeReplyResult>),
SetCluster(Address, String, SmallSender<NodeReplyResult>),
StopWorker(Address, bool, SmallSender<NodeReplyResult>),
StartProcessor(Address, SenderPair, SmallSender<NodeReplyResult>),
StopProcessor(Address, SmallSender<NodeReplyResult>),
StopNode(ShutdownType, SmallSender<NodeReplyResult>),
AbortNode,
StopAck(Address),
SenderReq(Address, SmallSender<NodeReplyResult>),
Router(TransportType, Address, SmallSender<NodeReplyResult>),
SetReady(Address),
CheckReady(Address, SmallSender<NodeReplyResult>),
}
Expand description
Messages sent from the Node to the Executor
Variants§
StartWorker
Fields
senders: SenderPair
Pair of senders to the worker relay (msgs and ctrl)
mailbox_count: Arc<AtomicUsize>
A mechanism to read channel fill-state for a worker
reply: SmallSender<NodeReplyResult>
Reply channel for command confirmation
Start a new worker and store the send handle
ListWorkers(SmallSender<NodeReplyResult>)
Return a list of all worker addresses
SetCluster(Address, String, SmallSender<NodeReplyResult>)
Add an existing address to a cluster
StopWorker(Address, bool, SmallSender<NodeReplyResult>)
Stop an existing worker
StartProcessor(Address, SenderPair, SmallSender<NodeReplyResult>)
Start a new processor
StopProcessor(Address, SmallSender<NodeReplyResult>)
Stop an existing processor
StopNode(ShutdownType, SmallSender<NodeReplyResult>)
Stop the node (and all workers)
AbortNode
Immediately stop the node runtime
StopAck(Address)
Let the router know a particular address has stopped
SenderReq(Address, SmallSender<NodeReplyResult>)
Request the sender for a worker address
Router(TransportType, Address, SmallSender<NodeReplyResult>)
Register a new router for a route id type
SetReady(Address)
Message the router to set an address as “ready”
CheckReady(Address, SmallSender<NodeReplyResult>)
Check whether an address has been marked as “ready”
Implementations§
source§impl NodeMessage
impl NodeMessage
sourcepub fn start_worker(
addrs: Vec<Address>,
senders: SenderPair,
detached: bool,
mailbox_count: Arc<AtomicUsize>
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn start_worker(
addrs: Vec<Address>,
senders: SenderPair,
detached: bool,
mailbox_count: Arc<AtomicUsize>
) -> (Self, SmallReceiver<NodeReplyResult>)
Create a start worker message
-
senders
: message and command senders for the relay -
detached
: indicate whether this worker address has a full relay behind it that can respond to shutdown commands. Setting this totrue
will disable stop ACK support in the router
sourcepub fn start_processor(
address: Address,
senders: SenderPair
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn start_processor(
address: Address,
senders: SenderPair
) -> (Self, SmallReceiver<NodeReplyResult>)
Create a start worker message
sourcepub fn stop_processor(
address: Address
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn stop_processor(
address: Address
) -> (Self, SmallReceiver<NodeReplyResult>)
Create a stop worker message and reply receiver
sourcepub fn list_workers() -> (Self, SmallReceiver<NodeReplyResult>)
pub fn list_workers() -> (Self, SmallReceiver<NodeReplyResult>)
Create a list worker message and reply receiver
sourcepub fn set_cluster(
addr: Address,
label: String
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn set_cluster(
addr: Address,
label: String
) -> (Self, SmallReceiver<NodeReplyResult>)
Create a set cluster message and reply receiver
sourcepub fn stop_worker(
address: Address,
detached: bool
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn stop_worker(
address: Address,
detached: bool
) -> (Self, SmallReceiver<NodeReplyResult>)
Create a stop worker message and reply receiver
sourcepub fn stop_node(tt: ShutdownType) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn stop_node(tt: ShutdownType) -> (Self, SmallReceiver<NodeReplyResult>)
Create a stop node message
sourcepub fn sender_request(route: Address) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn sender_request(route: Address) -> (Self, SmallReceiver<NodeReplyResult>)
Create a sender request message and reply receiver
sourcepub fn get_ready(addr: Address) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn get_ready(addr: Address) -> (Self, SmallReceiver<NodeReplyResult>)
Create a GetReady message and reply receiver