Enum ockam_node::NodeMessage
source · pub enum NodeMessage {
Show 15 variants
StartWorker {
addrs: Vec<Address>,
senders: SenderPair,
detached: bool,
mailbox_count: Arc<AtomicUsize>,
reply: SmallSender<NodeReplyResult>,
addresses_metadata: Vec<AddressAndMetadata>,
},
ListWorkers(SmallSender<NodeReplyResult>),
SetCluster(Address, String, SmallSender<NodeReplyResult>),
StopWorker(Address, bool, SmallSender<NodeReplyResult>),
StartProcessor {
addrs: Vec<Address>,
senders: SenderPair,
reply: SmallSender<NodeReplyResult>,
addresses_metadata: Vec<AddressAndMetadata>,
},
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>),
FindTerminalAddress(Vec<Address>, SmallSender<NodeReplyResult>),
GetMetadata(Address, SmallSender<NodeReplyResult>),
}
Expand description
Messages sent from the Node to the Executor
Variants§
StartWorker
Start a new worker and store the send handle
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
addresses_metadata: Vec<AddressAndMetadata>
List of metadata for each address
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
Start a new processor
Fields
senders: SenderPair
Pair of senders to the worker relay (msgs and ctrl)
reply: SmallSender<NodeReplyResult>
Reply channel for command confirmation
addresses_metadata: Vec<AddressAndMetadata>
List of metadata for each address
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”
FindTerminalAddress(Vec<Address>, SmallSender<NodeReplyResult>)
Find the terminal address for a given route
GetMetadata(Address, SmallSender<NodeReplyResult>)
Get address metadata
Implementations§
source§impl NodeMessage
impl NodeMessage
sourcepub fn start_worker(
addrs: Vec<Address>,
senders: SenderPair,
detached: bool,
mailbox_count: Arc<AtomicUsize>,
metadata: Vec<AddressAndMetadata>
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn start_worker( addrs: Vec<Address>, senders: SenderPair, detached: bool, mailbox_count: Arc<AtomicUsize>, metadata: Vec<AddressAndMetadata> ) -> (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(
addrs: Vec<Address>,
senders: SenderPair,
metadata: Vec<AddressAndMetadata>
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn start_processor( addrs: Vec<Address>, senders: SenderPair, metadata: Vec<AddressAndMetadata> ) -> (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
sourcepub fn find_terminal_address(
addrs: Vec<Address>
) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn find_terminal_address( addrs: Vec<Address> ) -> (Self, SmallReceiver<NodeReplyResult>)
Creates a NodeMessage::FindTerminalAddress message and reply receiver
sourcepub fn read_metadata(address: Address) -> (Self, SmallReceiver<NodeReplyResult>)
pub fn read_metadata(address: Address) -> (Self, SmallReceiver<NodeReplyResult>)
Creates a [NodeMessage::ReadMetadata] message and reply receiver
Trait Implementations§
source§impl Debug for NodeMessage
impl Debug for NodeMessage
Auto Trait Implementations§
impl Freeze for NodeMessage
impl !RefUnwindSafe for NodeMessage
impl Send for NodeMessage
impl Sync for NodeMessage
impl Unpin for NodeMessage
impl !UnwindSafe for NodeMessage
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more