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.
- Engine
Config - Configuration for the Engine.
- Input
Actor - Input actor that polls terminal events.
- KeyModifiers
- Key modifiers.
- Mouse
Event - Mouse event details.
- Renderer
Actor - Renderer actor that handles terminal output.
- Tick
- A tick event sent at regular intervals.
- Ticker
Actor - Ticker actor that generates regular timing events.
Enums§
- Agent
Event - Events from agent/network threads.
- Input
Event - Events from the input thread.
- KeyCode
- Key codes for keyboard input.
- Mouse
Button - Mouse button.
- Render
Command - Commands sent to the render thread.