pub struct NDArraySender { /* private fields */ }Expand description
Sender held by upstream.
§Default: drop-on-full (C++ parity)
By default publish uses a bounded try_send: when the downstream queue
is full the array is dropped and PublishOutcome::DroppedQueueFull is
returned, matching C++ NDPluginDriver::driverCallback trySend — a slow
plugin drops frames rather than back-pressuring the detector driver.
§blocking_callbacks=1: reliable opt-in
When blocking_callbacks is set, publish instead uses a reliable
send().await and waits for the downstream plugin to finish processing.
This is the explicit opt-in for “never drop, apply back-pressure”
behavior. It is NOT the default.
Implementations§
Source§impl NDArraySender
impl NDArraySender
Sourcepub async fn publish(&self, array: Arc<NDArray>) -> PublishOutcome
pub async fn publish(&self, array: Arc<NDArray>) -> PublishOutcome
Publish an array downstream.
enable_callbacks=0: returnsDisabled, array not sent.blocking_callbacks=0(default): boundedtry_send— on a full queue the array is dropped andDroppedQueueFullis returned (C++ parity).blocking_callbacks=1: reliablesend().await+ awaits downstream processing completion (explicit opt-in, never drops).
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether this sender’s plugin has callbacks enabled.
Sourcepub fn is_blocking(&self) -> bool
pub fn is_blocking(&self) -> bool
Whether this sender’s plugin is in blocking mode.
pub fn port_name(&self) -> &str
Sourcepub fn set_queued_counter(&mut self, counter: Arc<QueuedArrayCounter>)
pub fn set_queued_counter(&mut self, counter: Arc<QueuedArrayCounter>)
Set the queued-array counter for tracking in-flight arrays.
Sourcepub fn set_dropped_arrays_counter(&mut self, counter: Arc<AtomicI32>)
pub fn set_dropped_arrays_counter(&mut self, counter: Arc<AtomicI32>)
Attach the downstream plugin’s shared DroppedArrays counter so that
a full-queue drop on this sender is accounted to that plugin (C++ parity).
Sourcepub fn dropped_arrays_counter(&self) -> &Arc<AtomicI32> ⓘ
pub fn dropped_arrays_counter(&self) -> &Arc<AtomicI32> ⓘ
The shared DroppedArrays counter for this sender’s downstream queue.
Sourcepub fn max_capacity(&self) -> usize
pub fn max_capacity(&self) -> usize
Maximum capacity of the downstream input queue.
Trait Implementations§
Source§impl Clone for NDArraySender
impl Clone for NDArraySender
Source§fn clone(&self) -> NDArraySender
fn clone(&self) -> NDArraySender
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more