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

§addrs: Vec<Address>

The set of addresses in use by this worker

§senders: SenderPair

Pair of senders to the worker relay (msgs and ctrl)

§detached: bool

A detached context/ “worker” runs no relay state

§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

§addrs: Vec<Address>

The set of addresses in use by this processor

§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

source

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 to true will disable stop ACK support in the router

source

pub fn start_processor( addrs: Vec<Address>, senders: SenderPair, metadata: Vec<AddressAndMetadata> ) -> (Self, SmallReceiver<NodeReplyResult>)

Create a start worker message

source

pub fn stop_processor( address: Address ) -> (Self, SmallReceiver<NodeReplyResult>)

Create a stop worker message and reply receiver

source

pub fn list_workers() -> (Self, SmallReceiver<NodeReplyResult>)

Create a list worker message and reply receiver

source

pub fn set_cluster( addr: Address, label: String ) -> (Self, SmallReceiver<NodeReplyResult>)

Create a set cluster message and reply receiver

source

pub fn stop_worker( address: Address, detached: bool ) -> (Self, SmallReceiver<NodeReplyResult>)

Create a stop worker message and reply receiver

source

pub fn stop_node(tt: ShutdownType) -> (Self, SmallReceiver<NodeReplyResult>)

Create a stop node message

source

pub fn sender_request(route: Address) -> (Self, SmallReceiver<NodeReplyResult>)

Create a sender request message and reply receiver

source

pub fn set_ready(addr: Address) -> Self

Create a SetReady message and reply receiver

source

pub fn get_ready(addr: Address) -> (Self, SmallReceiver<NodeReplyResult>)

Create a GetReady message and reply receiver

source

pub fn find_terminal_address( addrs: Vec<Address> ) -> (Self, SmallReceiver<NodeReplyResult>)

Creates a NodeMessage::FindTerminalAddress message and reply receiver

source

pub fn read_metadata(address: Address) -> (Self, SmallReceiver<NodeReplyResult>)

Creates a [NodeMessage::ReadMetadata] message and reply receiver

Trait Implementations§

source§

impl Debug for NodeMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NodeMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more