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 DistributionBridgewhere
Mutex<VecDeque<OutboundHop>>: RefUnwindSafe,
Condvar: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
impl Send for DistributionBridge
impl Sync for DistributionBridge
impl Unpin for DistributionBridge
impl UnsafeUnpin for DistributionBridgewhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<OutboundHop>: UnsafeUnpin,
*const ArcInner<BridgeAccounts> is !null: UnsafeUnpin,
PhantomData<ArcInner<BridgeAccounts>>: UnsafeUnpin,
impl UnwindSafe for DistributionBridgewhere
Mutex<VecDeque<OutboundHop>>: UnwindSafe,
Condvar: UnwindSafe,
Arc<BridgeAccounts>: UnwindSafe,
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