Architecture
Turbostar is built on Python’s asyncio library, using an Event Loop pattern to manage concurrency without threading overhead.
The Core Components
Section titled “The Core Components”- The Dispatcher
(core/dispatcher.py)The brain of the operation.
- Parses the manifest.
- Creates asyncio.subprocess instances for each command.
- Holds asyncio.Event locks for dependency management.
- When Service A prints its “Ready Signal”, the Dispatcher unlocks the Event for Service A, allowing Service B (which was awaiting that event) to start.
- The Logger
(core/logger.py)The UI layer.
- Asynchronously reads stdout and stderr streams from all child processes.
- Injects ANSI colour codes based on configuration.
- Scans every line of text for “Ready Signals” to notify the Dispatcher.
Data Flow Diagram
Section titled “Data Flow Diagram”- User runs turbostar
- CLI loads manifest.json
- Dispatcher creates task list.
- Task A starts -> Pipes output to Logger.
- Task B waits (await dependency_event).
- Task A prints “Ready”.
- Logger detects “Ready” -> Sets Event.
- Task B wakes up -> Starts process.