Skip to main content

Crate memable

Crate memable 

Source
Expand description

§memable

An embeddable durable execution engine for Rust.

Unlike platforms such as Temporal or Restate, memable is a library — it runs inside your process with zero external dependencies. Workflows recover via key-based memoisation rather than positional replay, so you can deploy new code, fix bugs, and selectively re-execute steps without breaking in-flight workflows.

§Quick start

use memable::{Engine, Context, EngineError, WorkflowState};

async fn greet(ctx: Context) -> Result<(), EngineError> {
    let name: String = ctx.step("fetch-name:v1").run(async || {
        Ok("world".to_string())
    }).await?;
    let message: String = ctx.step("format-greeting:v1").run(async || {
        Ok(format!("Hello, {name}!"))
    }).await?;
    assert_eq!(message, "Hello, world!");
    Ok(())
}

let mut engine = Engine::builder().in_memory().build();
engine.register("greet", greet);
engine.start().await?;

let state = engine.invoke("greet").await?.wait().await;
assert_eq!(state, WorkflowState::Completed);

Structs§

Context
Workflow execution context.
Engine
The durable execution engine.
EngineBuilder
Builder for configuring and constructing an Engine.
Invocation
Handle for a running workflow instance.
StepBuilder
Builder for a durable step with optional timeout.
SuspendBuilder
Builder for a suspend point with optional status message.
WorkflowMetadata
Metadata record for a workflow instance.

Enums§

EngineError
Errors originating from the engine itself.
MetadataStatus
Lifecycle status of a workflow instance.
StepError
Error returned by step closures.
WorkflowState
Observable state of a workflow instance.