Skip to main content

Module actor

Module actor 

Source
Expand description

Actor Model: Message-passing concurrency for the TUI engine.

This module implements a simple actor system using crossbeam channels:

  • Input Actor: Polls terminal events, forwards to main loop
  • Render Actor: Receives render commands, diffs and flushes
  • Ticker Actor: Generates regular timing events for frame pacing
  • Main Loop: Coordinates between actors, handles application logic

§Architecture

┌──────────────┐     InputEvent      ┌──────────────┐
│ Input Thread │ ─────────────────▶  │              │
└──────────────┘                     │  Main Loop   │
                                     │              │
┌──────────────┐    RenderCommand    │              │
│Render Thread │ ◀───────────────── │              │
└──────────────┘                     └──────────────┘
       ▲                                   │
┌──────────────┐        Tick               │
│Ticker Thread │ ─────────────────▶        │
└──────────────┘                           │
                                           │ AgentEvent
                                           ▼
                                     ┌──────────────┐
                                     │ Agent/Network│
                                     └──────────────┘

Structs§

Engine
The main Flywheel engine.
EngineConfig
Configuration for the Engine.
InputActor
Input actor that polls terminal events.
KeyModifiers
Key modifiers.
MouseEvent
Mouse event details.
RendererActor
Renderer actor that handles terminal output.
Tick
A tick event sent at regular intervals.
TickerActor
Ticker actor that generates regular timing events.

Enums§

AgentEvent
Events from agent/network threads.
InputEvent
Events from the input thread.
KeyCode
Key codes for keyboard input.
MouseButton
Mouse button.
RenderCommand
Commands sent to the render thread.