pub struct TrackedSyncSender<T> { /* private fields */ }Expand description
A std::sync::mpsc::SyncSender that feeds a QueueGauge as items flow
through it, so a queue whose backing channel cannot report its own length
still participates in the centralized tracker.
send keeps the underlying blocking-backpressure semantics; it just records
the enqueue first so near-capacity warnings fire as the queue fills.
Implementations§
Source§impl<T> TrackedSyncSender<T>
impl<T> TrackedSyncSender<T>
Sourcepub fn send(&self, value: T) -> Result<(), SendError<T>>
pub fn send(&self, value: T) -> Result<(), SendError<T>>
Blocking send: record the enqueue, then hand off to the bounded channel (which parks the caller until a slot is free: clean backpressure).
Sourcepub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
pub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
Non-blocking send: record the enqueue only on success. Lets a caller with its own deadline poll instead of parking indefinitely on a full queue.
Sourcepub fn gauge(&self) -> &Arc<QueueGauge> ⓘ
pub fn gauge(&self) -> &Arc<QueueGauge> ⓘ
The gauge backing this sender.
Trait Implementations§
Source§impl<T> Clone for TrackedSyncSender<T>
impl<T> Clone for TrackedSyncSender<T>
Auto Trait Implementations§
impl<T> Freeze for TrackedSyncSender<T>
impl<T> RefUnwindSafe for TrackedSyncSender<T>
impl<T> Send for TrackedSyncSender<T>where
T: Send,
impl<T> Sync for TrackedSyncSender<T>where
T: Send,
impl<T> Unpin for TrackedSyncSender<T>
impl<T> UnsafeUnpin for TrackedSyncSender<T>
impl<T> UnwindSafe for TrackedSyncSender<T>
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