Skip to main content

OperatorRunner

Trait OperatorRunner 

Source
pub trait OperatorRunner {
    // Required method
    fn run_operator(
        &self,
        node_id: &NodeId,
        operator: OperatorDefinition,
        incoming_events: Receiver<Event>,
        handle: RuntimeHandle,
        init_done: Sender<Result<()>>,
        dataflow_descriptor: &Descriptor,
    ) -> Result<RunnerGuard>;
}
Expand description

A language/ABI-specific operator backend.

Each runtime backend (shared-library, Python, WASM, third-party, …) implements this trait and hands it to crate::main, which drives the language-neutral event loop. The implementation is invoked once, on the main thread (PyO3 and libloading both want a dedicated thread), and is responsible for loading the operator described by operator and running it until it stops.

The runtime↔operator contract is language-neutral: consume dora_node_api::Events off incoming_events, emit outputs and lifecycle events through handle, and signal readiness (or an init failure) exactly once on init_done.

A backend that cannot host operator’s source kind must return an Err without signalling init_done, so the failure surfaces as a spawn error rather than a runtime hang (dora-rs/dora#2595).

Required Methods§

Source

fn run_operator( &self, node_id: &NodeId, operator: OperatorDefinition, incoming_events: Receiver<Event>, handle: RuntimeHandle, init_done: Sender<Result<()>>, dataflow_descriptor: &Descriptor, ) -> Result<RunnerGuard>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§