Skip to main content

Crate cloacina_macros

Crate cloacina_macros 

Source
Expand description

§Cloacina Macros

Procedural macros for defining tasks and workflows in the Cloacina framework.

§Key Features

  • #[task] — define tasks with retry policies and trigger rules
  • #[workflow] — define workflows as modules containing #[task] functions
  • Compile-time validation of task dependencies and workflow structure
  • Automatic task and workflow registration
  • Code fingerprinting for task versioning

§Example

use cloacina::{task, workflow, Context, TaskError};

#[workflow(name = "my_pipeline", description = "Process data")]
pub mod my_pipeline {
    use super::*;

    #[task(id = "fetch", dependencies = [])]
    pub async fn fetch(ctx: &mut Context<Value>) -> Result<(), TaskError> { Ok(()) }

    #[task(id = "process", dependencies = ["fetch"])]
    pub async fn process(ctx: &mut Context<Value>) -> Result<(), TaskError> { Ok(()) }
}

Macros§

constructor_provider
Declare a constructor provider — a suite of #[constructor] members compiled into one WASM component (CLOACI-A-0011 / T-0837).

Attribute Macros§

batch_accumulator
Define a batch accumulator (buffers events, flushes on timer or size threshold).
computation_graph
Define a computation graph as a module containing async node functions.
constructor
Author a WASM constructor member in clean form (CLOACI-T-0826 / T-0837).
passthrough_accumulator
Define a passthrough accumulator (socket-only, no event loop).
polling_accumulator
Define a polling accumulator (timer-based, queries pull-based sources).
reactor
Declare a reactor as a unit struct.
state_accumulator
Define a state accumulator (bounded history buffer with DAL persistence).
stream_accumulator
Define a stream-backed accumulator.
task
Define a task with retry policies and trigger rules.
trigger
Define a trigger that fires a workflow on a schedule or condition.
workflow
Define a workflow as a module containing #[task] functions.