Skip to main content

Module reactor

Module reactor 

Source
Expand description

§Reactor Module

The core event loop for LaminarDB, implementing a single-threaded reactor pattern optimized for streaming workloads.

§Design Goals

  • Zero allocations during event processing
  • CPU-pinned execution for cache locality
  • Lock-free communication with other threads
  • 500K+ events/sec per core throughput

§Architecture

The reactor runs a tight event loop that:

  1. Polls input sources for events
  2. Routes events to operators
  3. Manages operator state
  4. Emits results to sinks

Communication with Ring 1 (background tasks) happens via SPSC queues.

Structs§

Reactor
The main reactor for event processing
ReactorConfig
Configuration for the reactor

Enums§

ReactorError
Errors that can occur in the reactor
SinkError
Errors that can occur in sinks.

Traits§

Sink
Trait for output sinks that consume reactor outputs.