Skip to main content

Crate sayiir_runtime

Crate sayiir_runtime 

Source
Expand description

Workflow runtime for executing durable workflows.

This crate provides the execution engine that drives sayiir_core workflows to completion. It re-exports the core crate, persistence layer, and proc-macros so most users only need a single dependency:

[dependencies]
sayiir-runtime = "0.1"

§Execution Strategies

ScenarioUse
Single server, crash recovery neededCheckpointingRunner
Multiple workers, horizontal scalingPooledWorker
Simple in-memory executionInProcessRunner

§Quick Example

use sayiir_runtime::{CheckpointingRunner, WorkflowRunner, workflow, task};
use sayiir_runtime::persistence::InMemoryBackend;

let backend = InMemoryBackend::new();
let runner = CheckpointingRunner::new(backend);

// Run a workflow with automatic checkpointing
// let status = runner.run(&workflow, "instance-123", input).await?;

§Re-exports

This crate re-exports key items for convenience:

For the full README with architecture diagrams and detailed configuration, see the crate README.

Re-exports§

pub use error::RuntimeError;
pub use execution::ResumeOutcome;
pub use execution::execute_continuation_async;
pub use execution::execute_continuation_sync;
pub use execution::execute_continuation_with_checkpointing;
pub use execution::finalize_execution;
pub use execution::prepare_resume;
pub use execution::prepare_run;
pub use execution::serialize_branch_results;
pub use worker::PooledWorker;
pub use worker::WorkerHandle;
pub use worker::WorkflowRegistry;
pub use sayiir_persistence as persistence;

Modules§

error
Typed error for the sayiir runtime layer.
execution
Shared workflow execution logic.
prelude
Convenience re-exports for common usage.
serialization
worker
Pooled worker for distributed, multi-worker workflow execution.

Macros§

sayiir_ctx
Macro to access the workflow context from within a task.
workflow
Builds a workflow pipeline with a concise DSL.

Structs§

CheckpointingRunner
A single-process workflow runner with checkpointing for crash recovery.
InProcessRunner
A workflow runner that executes workflows in-process.

Traits§

WorkflowRunner
A trait for executing workflows.

Attribute Macros§

task
Transforms an async function into a CoreTask implementation.