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 async fn publish_scatter(
&self,
array: Arc<NDArray>,
is_last: bool,
) -> PublishOutcome
pub async fn publish_scatter( &self, array: Arc<NDArray>, is_last: bool, ) -> PublishOutcome
Publish for the scatter reroute path. Mirrors C++ NDPluginScatter’s
auxStatus protocol: doNDArrayCallbacks writes the consumer’s
auxStatus before EVERY call — asynOverflow for each node it means
to reroute past, asynSuccess for the last (NDPluginScatter.cpp:83-84)
— so a full-queue consumer that is not the last is skipped without
counting a dropped array. Scatter writes the same cell
driverCallback arms on its own refusals, which is why this is an
arm/disarm of the episode rather than a bypass flag: were they two
mechanisms, a scatter round following a natural overflow would silence
the last node too.
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 admission(&self) -> &Arc<ArrayAdmission> ⓘ
pub fn admission(&self) -> &Arc<ArrayAdmission> ⓘ
The receiving plugin’s pre-queue gates, so the plugin runtime can keep them current from its param loop.
Sourcepub fn max_capacity(&self) -> usize
pub fn max_capacity(&self) -> usize
Maximum capacity of the downstream input queue.