pub struct WorkerExchange {
pub handle: Handle,
pub senders: HashMap<u32, LinkSender>,
pub receivers: Vec<LinkReceiver>,
}Expand description
This worker’s exchange endpoints for a multi-process run: one LinkSender per peer worker it
sends to, and one LinkReceiver per peer it receives from (established by the membership
handshake before start). Graph::start runs with none of this — a single-worker run where
every edge is a local SyncSender; the multi-process path is Graph::start_worker, which
derives the actual edge wiring from the placement.
The mechanism is identical either way — an out-edge is a bounded SyncSender, drained by the
dest task (local) or by an OutboundBridge (remote); an InboundBridge delivers a decoded
(edge, msg) into the local dest inbox exactly as a local outlet would. Edge ids agree across
workers because every worker builds the same graph in the same order, so the edge on the wire
names the same logical edge — and thus the same dest task — on both ends.
Fields§
§handle: HandleThe tokio runtime the bridges drive (block_on). Must be multi-threaded: its workers run
the links’ socket tasks while the bridge threads block on them.
senders: HashMap<u32, LinkSender>A link to each peer worker this worker sends edges to, keyed by that worker’s id.
receivers: Vec<LinkReceiver>A link from each peer this worker receives edges from; each delivers its frames as
(edge, msg) into local inboxes, routed by the edge’s target task.
Auto Trait Implementations§
impl Freeze for WorkerExchange
impl RefUnwindSafe for WorkerExchange
impl Send for WorkerExchange
impl Sync for WorkerExchange
impl Unpin for WorkerExchange
impl UnsafeUnpin for WorkerExchange
impl UnwindSafe for WorkerExchange
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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