pub struct ExchangeControls { /* private fields */ }Expand description
A payload-free SHM table with a fixed number of records per caller lane. Its kind and capacity belong to the protocol that opts into the table.
Implementations§
Source§impl ExchangeControls
impl ExchangeControls
Sourcepub fn open(
segment: Arc<LinkSegment>,
kind: u8,
slots_per_lane: u32,
) -> Result<Self>
pub fn open( segment: Arc<LinkSegment>, kind: u8, slots_per_lane: u32, ) -> Result<Self>
Open the control table in the Link’s exact namespace and access scope. The kind must be distinct from all other resources in that namespace.
Sourcepub fn reserve(
self: &Arc<Self>,
caller: &Joined,
runner: usize,
runner_epoch: u64,
) -> Result<Option<ExchangeControl>>
pub fn reserve( self: &Arc<Self>, caller: &Joined, runner: usize, runner_epoch: u64, ) -> Result<Option<ExchangeControl>>
Reserve in the caller’s own lane. A full table leaves dispatch to the
protocol. Hold the returned lease until the reply is delivered or
the caller stops waiting. None means all records are in use.
Sourcepub fn state(
&self,
ticket: ExchangeControlTicket,
) -> Result<ExchangeControlState>
pub fn state( &self, ticket: ExchangeControlTicket, ) -> Result<ExchangeControlState>
Read the latest control state. A reclaimed or released ticket is stale. For the Runner, caller-side staleness also ends the wait. For the caller, Runner retirement alone cannot prove failure: drain committed replies after producer recovery before abandoning a stale exchange.
To await a change, drive the local inbox receiver and recheck after
Received::Capacity or a directory change. The bell carries no result.
Sourcepub fn caller_state(
&self,
ticket: ExchangeControlTicket,
) -> Result<ExchangeControlState>
pub fn caller_state( &self, ticket: ExchangeControlTicket, ) -> Result<ExchangeControlState>
Read the caller’s terminal record even after the Runner’s lane has been retired. An unchanged pending record still requires inbox recovery.
Sourcepub fn fail(
&self,
runner: &Joined,
ticket: ExchangeControlTicket,
) -> Result<bool>
pub fn fail( &self, runner: &Joined, ticket: ExchangeControlTicket, ) -> Result<bool>
Record a permanent failure to publish a reply that has never been committed. A transient full inbox does not fail an exchange. Runner death is not a failure publication: a reply may already be committed. Recover the dead producer and drain its committed replies.