Skip to main content

Module runtime

Module runtime 

Source
Expand description

One object to run transforms with.

A Runtime bundles the three things every host otherwise wires by hand: a Registry over the transform directories you point it at, the Backends you register, and a cache of loaded transforms so load happens once per selector and run is the hot path. Build one at startup and share it (Arc<Runtime>) across threads or partitions.

use fv_compute::Runtime;

let runtime = Runtime::builder()
    .root("./transforms")      // every `<dir>/transform.toml` under it
    .backend(backend())        // e.g. fv_compute_wasm::WasmBackend::new()?
    .build()?;

let out = runtime.run("spikeTotal", &[batch()])?;   // "id" or "id@version"

Structsยง

Runtime
A registry, its backends, and a cache of loaded transforms. See the module docs.
RuntimeBuilder
Builds a Runtime: roots in precedence order (later roots override earlier ones for the same id@version) and the backends to dispatch to.