Skip to main content

Module process

Module process 

Source
Expand description

Process — ergonomic typed handle for a single MaKo process instance.

Instead of threading stream_id, workflow_id, tenant_id, and a store reference through every call to the write path, bind them once into a Process<W, S> and call execute / state directly.

§Starting a new process

use mako_engine::{
    event_store::InMemoryEventStore,
    ids::TenantId,
    process::Process,
    version::WorkflowId,
};

let store = InMemoryEventStore::new();
let process = Process::<MyWorkflow, _>::new(
    store,
    TenantId::new(),
    WorkflowId::new("my-workflow", "FV2024-10-01"),
);

let envelopes = process.execute(my_command).await?;
let current   = process.state().await?;

§Resuming an existing process

let process = Process::<MyWorkflow, _>::from_stream(
    store, stream_id, process_id, tenant_id, workflow_id,
);

Structs§

Process
An ergonomic typed handle for a single MaKo process instance.