pub struct PayloadArena { /* private fields */ }Expand description
One fleet-wide payload allocation table. Every producer allocates from its node’s exclusive lane, independent of which exchange side it currently holds.
Implementations§
Source§impl PayloadArena
impl PayloadArena
pub fn open( fleet: Arc<Fleet>, incarnation: Incarnation, spec: PayloadArenaSpec, ) -> Result<Self>
pub fn kind(&self) -> u8
pub fn slot_size(&self) -> usize
pub fn slots_per_node(&self) -> usize
pub fn chunk_geometry(&self) -> ChunkGeometry
pub fn plan_chunks(&self, data_bytes: usize) -> Result<ChunkPlan>
pub fn plan_chunks_with( &self, data_bytes: usize, slots_per_chunk: usize, ) -> Result<ChunkPlan>
Sourcepub fn wait_available(&self, payload_len: usize) -> Result<()>
pub fn wait_available(&self, payload_len: usize) -> Result<()>
Park this thread until a run large enough for payload_len may be
available. Allocation still decides the race after the wake.
Sourcepub fn is_available(&self, payload_len: usize) -> Result<bool>
pub fn is_available(&self, payload_len: usize) -> Result<bool>
Whether this producer lane currently has a contiguous run for the payload. This is only a readiness snapshot; allocation still decides a race between concurrent producers.
Sourcepub fn poll_available(
&self,
payload_len: usize,
cx: &mut Context<'_>,
) -> Poll<Result<()>>
pub fn poll_available( &self, payload_len: usize, cx: &mut Context<'_>, ) -> Poll<Result<()>>
Task readiness for this node’s payload credit. Credit returns are coalesced through one shared generation and one local driver.
Sourcepub fn reset_all(&self)
pub fn reset_all(&self)
Clear this arena only while the fleet is known quiescent. Normal attach and replacement never call this implicitly.
Sourcepub fn node_dead(&self, node: NodeId, incarnation: Incarnation)
pub fn node_dead(&self, node: NodeId, incarnation: Incarnation)
Reclaim only allocations owned by a process incarnation whose death was confirmed by the embedder. A producer’s unpublished or unread chunks and a dead reader’s held chunks return; a chunk already held by a surviving consumer remains that consumer’s.