hojicha-runtime
Event loop and async runtime for the Hojicha TUI framework.
Purpose
This crate provides the runtime engine that powers Hojicha applications:
- Main event loop with priority-based event processing
- Async task management and cancellation
- Terminal handling and panic recovery
- Resource limits and backpressure control
- Stream subscriptions for external events
Basic Usage
use Program;
use Model;
// Assuming you have a Model implementation
async
Key Features
Async Event Handling
- External events: Send events from other threads via
init_async_bridge() - Stream subscriptions: Connect any
futures::Streamwithsubscribe() - Cancellable tasks: Spawn with automatic cancellation via
spawn_cancellable() - Resource limits: Prevent resource exhaustion with configurable limits
Panic Recovery
The runtime includes panic recovery to restore the terminal on application panic.
Testing Support
Test harness utilities for behavioral testing.
Documentation
For full documentation and more examples, see the main Hojicha documentation.
License
GPL-3.0 - See LICENSE file for details