pub struct Runtime { /* private fields */ }Expand description
A registry, its backends, and a cache of loaded transforms. See the module docs.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn builder() -> RuntimeBuilder
pub fn builder() -> RuntimeBuilder
Start building a runtime: add roots and backends, then RuntimeBuilder::build.
Sourcepub fn new(registry: Registry, backends: Backends) -> Self
pub fn new(registry: Registry, backends: Backends) -> Self
Wrap an already-built registry and backend set.
Sourcepub fn load(&self, selector: &str) -> Result<Arc<dyn Compute>, ComputeError>
pub fn load(&self, selector: &str) -> Result<Arc<dyn Compute>, ComputeError>
Resolve selector (id or id@version) and load it through its backend. The loaded
transform is cached by selector, so repeated calls are a map lookup; the expensive work
(compiling a component, resolving an image) happens once.
Sourcepub fn run(
&self,
selector: &str,
inputs: &[RecordBatch],
) -> Result<RecordBatch, ComputeError>
pub fn run( &self, selector: &str, inputs: &[RecordBatch], ) -> Result<RecordBatch, ComputeError>
Load (cached) and run selector over inputs, one batch per declared input.
Sourcepub fn ensure_loadable(&self, selector: &str) -> Result<(), ComputeError>
pub fn ensure_loadable(&self, selector: &str) -> Result<(), ComputeError>
Load selector without running it. Call this when a job is configured, so a missing or
broken transform fails the job up front instead of failing every batch later.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Drop every cached transform. The next load of each selector goes through its backend
again — use after the transform directories change on disk.