Skip to main content

Module core

Module core 

Source
Expand description

Main event loop implementation.

This module contains the core orchestrate-handle-reduce cycle that drives the reducer-based pipeline. The event loop coordinates pure reducer logic with impure effect handlers, maintaining strict separation of concerns.

§Event Loop Cycle

State → Orchestrate → Effect → Handle → Event → Reduce → Next State
        (pure)                 (impure)         (pure)

The loop continues until reaching a terminal state (Interrupted, Completed) or until max iterations is exceeded.

§Architecture

The event loop is organized into several modules:

  • driver - Main iteration loop implementing orchestrate→handle→reduce cycle
  • recovery - Defensive completion and max iterations handling
  • error_handling - Panic recovery and error routing
  • trace - Trace buffer and diagnostic dumps
  • config - Configuration and initialization

Traits§

StatefulHandler
Trait for handlers that maintain internal state.

Functions§

run_event_loop
Run the main event loop for the reducer-based pipeline.
run_event_loop_with_handler
Run the event loop with a custom effect handler.