Skip to main content

InterCoreTransport

Struct InterCoreTransport 

Source
pub struct InterCoreTransport { /* private fields */ }
Expand description

Cross-core routing transport backed by InterCoreQueue ring buffers.

When the destination actor lives on a different core, the message is pushed to rings[my_core][dest_core] instead of being delivered directly. The receiving core’s event loop is responsible for draining its inbound rings.

Falls back to the local InProcessTransport when the destination is on the same core or has no placement entry.

After each successful cross-core push the sender signals the destination core’s entry in the shared has_work flag array (cache-line padded to prevent false sharing). The drain task on the destination core uses this flag to break out of its spin window early and to skip the expensive yield_now() / Tokio wakeup when more inter-core work is already in flight.

Implementations§

Source§

impl InterCoreTransport

Source

pub fn new( my_core: usize, num_cores: usize, capacity: usize, placement: Arc<PlacementMap>, local: Arc<InProcessTransport>, ) -> Self

Create a new InterCoreTransport owning an N×N ring buffer matrix and a private has_work flag array.

capacity is the number of messages each ring can hold before returning TransportError::MailboxFull.

When multiple transport instances need to share the same flag array (i.e. cross-core signalling in MultiCoreEngine), construct the struct directly using the public fields rather than calling this constructor.

Source

pub fn try_deliver( &self, envelope: Envelope, payload: MessagePayload, ) -> Result<(), TransportError>

Deliver a message, routing cross-core via the ring buffer if needed.

Trait Implementations§

Source§

impl Transport for InterCoreTransport

Source§

fn try_send( &self, envelope: Envelope, payload: MessagePayload, ) -> Result<(), TransportError>

Synchronous non-blocking send. Returns MailboxFull if the transport’s outbound buffer is full.
Source§

fn send<'a>( &'a self, envelope: Envelope, payload: MessagePayload, ) -> TransportFuture<'a>

Source§

fn register( &self, _addr: AddrHash, _mailbox: MailboxSender, ) -> Result<(), TransportError>

Source§

fn unregister(&self, _addr: AddrHash) -> Result<(), TransportError>

Source§

fn can_route(&self, destination: AddrHash) -> bool

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

Source§

fn upcast(self) -> T

Source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

Source§

fn upcast_from(value: Counter<T, B>) -> T

Source§

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

Source§

fn vzip(self) -> V