Skip to main content

Crate aion

Crate aion 

Source
Expand description

Transport-agnostic Aion workflow engine with durability, replay, timers, and supervision.

The engine embeds beamr, loads .aion packages, owns workflow lifecycle and process residency, records and replays durable history, and exposes seams for activities, events, signals, queries, and server transports.

§Example

use std::sync::Arc;

use aion::EngineBuilder;
use aion_store::{EventStore, InMemoryStore};

let store: Arc<dyn EventStore> = Arc::new(InMemoryStore::default());
let engine = EngineBuilder::new()
    .store_arc(store)
    .in_memory_visibility()
    .build()
    .await?;

§Cargo features

  • beamr_query_reentry_fixed (off by default): compiles the batch-orchestrator example e2e tests (tests/example_query_reentry.rs) that drive live queries through the Gleam SDK’s query pump while a parent is parked in child.await. The engine-side query protocol is fully functional, but the example’s child-result decode path hit beamr 0.4.9 VM gaps in gleam_json/gleam_stdlib; enable the feature once the upstream beamr fixes land and the pin is bumped.

    NOTE: the crate is now pinned to beamr 0.6.4. The gap this gate guards against was identified on 0.4.9 and may have been fixed upstream, so the gate needs re-validation against 0.6.4 and may now be stale.

Re-exports§

pub use activity::ActivityDispatch;
pub use activity::ActivityDispatcher;
pub use activity::dispatch_activity;
pub use activity::propagate_activity_outcome;
pub use activity::surface_activity_error;
pub use durability::ActiveWorkflowRecoverySeamImpl;
pub use engine::DeferredEventPublisher;
pub use engine::DeferredQueryService;
pub use engine::DeferredSignalRouter;
pub use engine::DelegatedSeams;
pub use engine::Engine;
pub use engine::EngineBuilder;
pub use engine::EventFamily;
pub use engine::EventFilter;
pub use engine::EventPublisher;
pub use engine::EventStreamLagged;
pub use engine::QueryService;
pub use engine::SignalRouter;
pub use engine::schedule_coordinator_workflow_id;
pub use engine_seam::EngineHandle;
pub use error::EngineError;
pub use error::PinHolder;
pub use error::SignalRouterError;
pub use loader::LoadOutcome;
pub use loader::LoadedWorkflow;
pub use loader::WorkflowCatalog;
pub use loader::WorkflowVersionInfo;
pub use publish::BroadcastEventPublisher;
pub use publish::PublishError;
pub use publish::PublishingEventStore;
pub use query::ConcreteQueryService;
pub use query::QueryError;
pub use registry::CompletionNotifier;
pub use registry::HandleResidency;
pub use registry::Registry;
pub use registry::Residency;
pub use registry::TerminalOutcome;
pub use registry::WorkflowHandle;
pub use registry::WorkflowHandleParts;
pub use runtime::PARKED_ACTIVITY_REASON;
pub use runtime::Pid;
pub use runtime::RuntimeConfig;
pub use runtime::RuntimeHandle;
pub use runtime::RuntimeInput;
pub use runtime::SignalDeliveryConfig;
pub use runtime::is_parked_reason;
pub use schedule::ScheduleError;
pub use schedule::next_fire_time;
pub use schedule::parse_cron_expression;
pub use supervision::EngineSupervisorId;
pub use supervision::SupervisionTree;
pub use supervision::TypeSupervisorId;
pub use supervision::TypeSupervisorNode;
pub use supervision::WorkflowNode;

Modules§

activity
Activity dispatch bridge and error propagation helpers. Activity dispatch bridges and helpers.
child
Child-workflow spawn support. Child-workflow spawning helpers.
durability
Durable command recording, replay, and recovery support. pub mod declarations + re-exports only
engine
Engine builder, runtime APIs, and delegated seams. Engine API, builder, and delegated seam surfaces.
engine_seam
Handle type exposed by embedded engine seams. Engine-facing seam for time, signal, query, child, and concurrency services.
error
Engine and routing error types. Engine error taxonomy.
lifecycle
Workflow lifecycle start, transition, visibility, and termination helpers. Workflow lifecycle operations: start, terminate, suspend, and resume.
loader
.aion package loading into runtime modules. Workflow package loading surfaces.
publish
Live event publication: publish-after-commit store wrapper and publisher. Live event publication: publish-after-commit store wrapper and the broadcast-backed crate::EventPublisher implementation.
query
Query dispatch services and mailbox support. Workflow query service types.
registry
Active workflow registry and handle residency tracking. Workflow registry handles and tables.
runtime
BEAM runtime configuration, handles, NIFs, and workflow process support. Sole beamr boundary for aion per D1; other modules use RuntimeHandle.
schedule
Schedule evaluation and cron parsing support. Schedule trigger parsing, state projection, policy, and timer-driven evaluation.
signal
Signal routing and resume handoff support. Workflow signal routing and resume handoff support.
supervision
Supervision tree models for engines, workflow types, and workflow instances. Workflow and activity supervision policies.
time
Timer creation, recovery, and wake-up services. Named timers, timer recovery, and timer service support.