Skip to main content

Module reactor

Module reactor 

Source
Expand description

Reactor pattern — fire-and-forget side effects in response to events.

Lighter than crate::saga::SagaPattern: no per-correlation state, no command dispatch, no compensation. Just “for each event, run this side-effect closure.” Commonly used for notifications, metrics emission, log aggregation.

ReactorPattern::<OrderEvent>::builder()
    .name("notifier")
    .events(bus.subscribe())
    .reaction(|e| async move { send_notification(e).await; })
    .build()?
    .materialize(&system)
    .await?;

Structs§

ReactorBuilder
ReactorHandles
ReactorPattern
ReactorTopology