pub struct PluginRuntimeHandle {
pub ndarray_params: NDArrayDriverParams,
pub plugin_params: PluginBaseParams,
/* private fields */
}Expand description
Handle to a running plugin runtime. Provides access to sender and port handle.
Fields§
§ndarray_params: NDArrayDriverParams§plugin_params: PluginBaseParamsImplementations§
Source§impl PluginRuntimeHandle
impl PluginRuntimeHandle
pub fn port_runtime(&self) -> &PortRuntimeHandle
pub fn array_sender(&self) -> &NDArraySender
pub fn array_output(&self) -> &Arc<Mutex<NDArrayOutput>> ⓘ
Sourcepub fn wait_params_applied(&self, timeout: Duration) -> bool
pub fn wait_params_applied(&self, timeout: Duration) -> bool
Block until the plugin’s data thread has applied every control-plane param change submitted before this call.
write_*_blocking on the port handle returns once the port actor has
recorded the write and queued it for the data plane; the data thread
applies it (the EnableCallbacks flip, NDArrayPort/NDArrayAddr rewiring,
processor param updates) asynchronously. This is the fence between the
two planes: it enqueues a barrier behind every already-queued change
and waits for the data thread to acknowledge it — the param channel is
FIFO, so the ack implies every earlier change is fully applied.
The ack additionally waits for the array queue to drain, so it also implies every array published before this call has been fully handled (processed or throttled). Under continuous array traffic the ack is therefore delayed until the queue momentarily empties.
Returns false if the data thread has exited or timeout elapsed.
Sourcepub fn set_max_threads(&self, max_threads: i32)
pub fn set_max_threads(&self, max_threads: i32)
Apply C’s maxThreads *Configure argument (NDPluginDriver.cpp:117,
:158) to an already-built plugin.
In C this is a constructor argument and nothing else: writeInt32 has
no MaxThreads arm, and MaxThreads_RBV is a longin with no output
partner (NDPluginBase.template:290-295), so the configure line is an
operator’s only route to the ceiling. create_plugin_runtime* takes no
such argument, so the configure command applies it here instead.
It goes through the one owner allowed to assign max_threads — the
data loop’s MAX_THREADS arm, which floors the value, clamps
NumThreads to the new ceiling and writes both readbacks back. Seeding
the shared state from a second site instead would let the ceiling the
pool runs on drift from the one MaxThreads_RBV publishes, which is
the one disagreement a reader of that record cannot detect.
Blocks until the data thread has applied it, so the ceiling is in place before the configure command returns, as it is in C.