pub struct DistributionBridge { /* private fields */ }Expand description
Queue the host drains. Share one Arc via crate::RuntimeConfig::distribution.
Pending hops consume both a hop slot and a byte reservation until the
host drops the OutboundHop (after encode/send or discard). This is
independent of per-flow crate::QuotaConfig memory — a finalized flow
must not erase bridge retention.
Implementations§
Source§impl DistributionBridge
impl DistributionBridge
pub fn new() -> Arc<Self> ⓘ
pub fn with_config(cfg: DistributionConfig) -> Arc<Self> ⓘ
Sourcepub fn try_recv(&self) -> Result<Option<OutboundHop>, RuntimeError>
pub fn try_recv(&self) -> Result<Option<OutboundHop>, RuntimeError>
Next hop, if the host has not fallen behind.
The returned hop still holds its byte reservation until dropped.
Sourcepub fn outbound_pending(&self) -> Result<usize, RuntimeError>
pub fn outbound_pending(&self) -> Result<usize, RuntimeError>
Hops waiting on the bridge queue (not yet try_recv’d by the host).
Sourcepub fn pending_charged_hops(&self) -> usize
pub fn pending_charged_hops(&self) -> usize
Hop slots charged (queue + hops held by the host after recv).
Sourcepub fn pending_charged_bytes(&self) -> usize
pub fn pending_charged_bytes(&self) -> usize
Bytes charged (queue + hops held by the host after recv).
Sourcepub fn recv_timeout(
&self,
timeout: Duration,
) -> Result<Option<OutboundHop>, RuntimeError>
pub fn recv_timeout( &self, timeout: Duration, ) -> Result<Option<OutboundHop>, RuntimeError>
Block until a hop arrives or timeout elapses.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DistributionBridge
impl Forget for DistributionBridge
impl Move for DistributionBridge
impl RefUnwindSafe for DistributionBridge
impl Send for DistributionBridge
impl Sync for DistributionBridge
impl Unpin for DistributionBridge
impl UnsafeUnpin for DistributionBridge
impl UnwindSafe for DistributionBridge
Blanket Implementations§
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
Mutably borrows from an owned value. Read more