Enum ockam::NodeMessage
source · [−]pub enum NodeMessage {
Show 13 variants
StartWorker {
addrs: AddressSet,
senders: SenderPair,
bare: bool,
reply: Sender<Result<NodeReply, NodeError>>,
},
ListWorkers(Sender<Result<NodeReply, NodeError>>),
SetCluster(Address, String, Sender<Result<NodeReply, NodeError>>),
StopWorker(Address, Sender<Result<NodeReply, NodeError>>),
StartProcessor(Address, SenderPair, Sender<Result<NodeReply, NodeError>>),
StopProcessor(Address, Sender<Result<NodeReply, NodeError>>),
StopNode(ShutdownType, Sender<Result<NodeReply, NodeError>>),
AbortNode,
StopAck(Address),
SenderReq(Address, Sender<Result<NodeReply, NodeError>>),
Router(u8, Address, Sender<Result<NodeReply, NodeError>>),
SetReady(Address),
CheckReady(Address, Sender<Result<NodeReply, NodeError>>),
}
Expand description
Messages sent from the Node to the Executor
Variants
StartWorker
Fields
addrs: AddressSet
The set of addresses in use by this worker
bare: bool
A bare worker runs no relay state
Start a new worker and store the send handle
ListWorkers(Sender<Result<NodeReply, NodeError>>)
Return a list of all worker addresses
SetCluster(Address, String, Sender<Result<NodeReply, NodeError>>)
Add an existing address to a cluster
StopWorker(Address, Sender<Result<NodeReply, NodeError>>)
Stop an existing worker
StartProcessor(Address, SenderPair, Sender<Result<NodeReply, NodeError>>)
Start a new processor
StopProcessor(Address, Sender<Result<NodeReply, NodeError>>)
Stop an existing processor
StopNode(ShutdownType, Sender<Result<NodeReply, NodeError>>)
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, Sender<Result<NodeReply, NodeError>>)
Request the sender for a worker address
Router(u8, Address, Sender<Result<NodeReply, NodeError>>)
Register a new router for a route id type
SetReady(Address)
Message the router to set an address as “ready”
CheckReady(Address, Sender<Result<NodeReply, NodeError>>)
Check whether an address has been marked as “ready”
Implementations
sourceimpl NodeMessage
impl NodeMessage
sourcepub fn start_worker(
addrs: AddressSet,
senders: SenderPair,
bare: bool
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn start_worker(
addrs: AddressSet,
senders: SenderPair,
bare: bool
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a start worker message
-
senders
: message and command senders for the relay -
bare
: 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
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn start_processor(
address: Address,
senders: SenderPair
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a start worker message
sourcepub fn stop_processor(
address: Address
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn stop_processor(
address: Address
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a stop worker message and reply receiver
sourcepub fn list_workers() -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn list_workers() -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a list worker message and reply receiver
sourcepub fn set_cluster(
addr: Address,
label: String
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn set_cluster(
addr: Address,
label: String
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a set cluster message and reply receiver
sourcepub fn stop_worker(
address: Address
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn stop_worker(
address: Address
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a stop worker message and reply receiver
sourcepub fn stop_node(
tt: ShutdownType
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn stop_node(
tt: ShutdownType
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a stop node message
sourcepub fn sender_request(
route: Address
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
pub fn sender_request(
route: Address
) -> (NodeMessage, Receiver<Result<NodeReply, NodeError>>)
Create a sender request message and reply receiver
sourcepub fn set_ready(addr: Address) -> NodeMessage
pub fn set_ready(addr: Address) -> NodeMessage
Create a SetReady message and reply receiver
Trait Implementations
sourceimpl Debug for NodeMessage
impl Debug for NodeMessage
Auto Trait Implementations
impl !RefUnwindSafe for NodeMessage
impl Send for NodeMessage
impl Sync for NodeMessage
impl Unpin for NodeMessage
impl !UnwindSafe for NodeMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more