#execution-engine #events #step #stream #serialization #event-stream #oxide #api-client #update-engine

oxide-update-engine

A framework for declaring and executing sequential update steps with serializable event streams

1 unstable release

Uses new Rust 2024

0.1.0 Feb 27, 2026

#488 in Asynchronous

MPL-2.0 license

275KB
5.5K SLoC

oxide-update-engine

License: MPL-2.0 crates.io docs.rs Rust: ^1.88.0

An engine for declaring and executing sequential update steps with serializable event streams.

The oxide-update-engine crate provides the execution engine for running update steps.

Examples

A minimal engine that runs a single update step:

use oxide_update_engine::{
    StepSuccess, UpdateEngine, channel,
};
use oxide_update_engine::types::spec::EngineSpec;

// A EngineSpec defines the domain-specific types that flow
// through the engine. Use () for metadata you don't need.
enum MySpec {}
impl EngineSpec for MySpec {
    fn spec_name() -> String {
        "example".into()
    }
    type Component = String;
    type StepId = usize;
    type StepMetadata = ();
    type ProgressMetadata = ();
    type CompletionMetadata = ();
    type SkippedMetadata = ();
    type Error = anyhow::Error;
}

let log =
    slog::Logger::root(slog::Discard, slog::o!());
let (sender, _receiver) = channel::<MySpec>();
let engine = UpdateEngine::new(&log, sender);

// Steps run sequentially in registration order.
engine
    .new_step(
        "fw".to_owned(),
        1,
        "Write firmware image",
        |_cx| async {
            // ... perform update work here ...
            StepSuccess::new(()).into()
        },
    )
    .register();

engine.execute().await?;

For more complex engines, including engines that have nested local and remote steps, see the full example.

License

This project is available under the terms of the Mozilla Public License 2.0.

Dependencies

~5.5–8MB
~126K SLoC