Skip to main content

Module runtime

Module runtime 

Source
Expand description

Plugin runtime: control plane (PortActor) + data plane (processing thread).

§Single-threaded data plane (intentional, G4)

C++ NDPluginDriver runs numThreads worker threads sharing one input queue (createCallbackThreads). The Rust port deliberately runs exactly one per-plugin data thread driving a tokio::select! loop. This is an intentional design choice: a single owner of the processing state removes the C++ worker-pool races (shared prevUniqueId_, sort-buffer contention) and keeps array ordering trivially correct. The NUM_THREADS / MAX_THREADS PVs are therefore not backed by a real worker pool — instead NumThreads is validated and clamped to [1, MaxThreads] on write and the clamped value is written back, so the PV is honest about the accepted value rather than silently inert.

Structs§

ParamChangeResult
Result of handling a control-plane param change.
PluginParamSnapshot
Read-only snapshot of param values available to the processing thread.
PluginPortDriver
PortDriver implementation for a plugin’s control plane.
PluginRuntimeHandle
Handle to a running plugin runtime. Provides access to sender and port handle.
ProcessResult
Result of processing one array: output arrays + param updates to write back.

Enums§

ParamChangeValue
Value sent through the param change channel from control plane to data plane.
ParamUpdate
A single parameter update produced by a plugin’s process_array.

Traits§

NDPluginProcess
Pure processing logic. No threading concerns.

Functions§

create_plugin_runtime
Create a plugin runtime with control plane (PortActor) and data plane (processing thread).
create_plugin_runtime_multi_addr
Create a plugin runtime with multi-addr support.
create_plugin_runtime_with_output
Create a plugin runtime with a pre-wired output (for testing and direct wiring).
wire_downstream
Connect a downstream plugin’s sender to a plugin runtime’s output.