You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(Echo): Improve code clarity, documentation, and API consistency
Refactored the Echo scheduler crate to enhance readability, maintainability, and consistency with Land's architectural principles. Key changes include:
- Renamed `SchedulerBuilder::Count` to `WithWorkerCount` and `SchedulerBuilder::Queue` to `WithQueue` for clearer fluent API semantics
- Simplified work-stealing logic in `Queue::StealingQueue` with improved error handling and reduced allocations
- Updated module and function documentation throughout to better explain Echo's role as Mountain's execution engine
- Revised README and Deep Dive docs to reflect architectural relationships with Mountain's ActionEffect system
- Renamed internal fields for clarity (e.g., `Handle` → `WorkerHandles`, `Running` → `IsRunning`)
These changes ensure Echo remains a robust foundation for Mountain's structured concurrency model, where it executes ActionEffect futures via Tauri's async runtime. The improved documentation clarifies Echo's integration points with Mountain's Track dispatcher and environment services.
Refs #291#292#290
|**Performance**| Use lock-free data structures (`crossbeam-deque`) and a high-performance work-stealing algorithm to achieve maximum throughput and low-latency task execution. |`Queue::StealingQueue`, `Scheduler::Worker`|
64
-
|**Structured Concurrency**| Manage all asynchronous operations within a supervised pool of workers, providing graceful startup and shutdown, unlike fire-and-forget `tokio::spawn`. |`Scheduler::Scheduler`, `Scheduler::SchedulerBuilder`|
65
-
|**Decoupling**| Separate the generic **Queueing Logic** from the application-specific **Scheduler Implementation**. The scheduler uses the queue to run its tasks. |`Queue::StealingQueue<T>`, `Scheduler::Scheduler`, `Task::Task::Task`|
66
-
|**Resilience**| The scheduler's design is inherently resilient; the failure of one task (if it panics) is contained within its `tokio` task and does not crash the worker pool. |`Scheduler::Worker::Run`|
67
-
|**Composability**| Provide a simple `Submit` API that accepts any `Future<Output = ()>`, making it easy to integrate with any asynchronous Rust code. |`Task::Task::Task`, `Scheduler::Scheduler::Submit`|
|**Performance**| Use lock-free data structures (`crossbeam-deque`) and a high-performance work-stealing algorithm to achieve maximum throughput and low-latency task execution. |`Queue::StealingQueue`, `Scheduler::Worker`|
64
+
|**Structured Concurrency**| Manage all asynchronous operations within a supervised pool of workers, providing graceful startup and shutdown, unlike fire-and-forget `tokio::spawn`. |`Scheduler::Scheduler`, `Scheduler::SchedulerBuilder`|
65
+
|**Decoupling**| Separate the generic **Queueing Logic** from the application-specific **Scheduler Implementation**. The scheduler uses the queue to run its tasks. |`Queue::StealingQueue<TTask>`, `Scheduler::Scheduler`, `Task::Task`|
66
+
|**Resilience**| The scheduler's design is inherently resilient; the failure of one task (if it panics) is contained within its `tokio` task and does not crash the worker pool. |`Scheduler::Worker::Run`|
67
+
|**Composability**| Provide a simple `Submit` API that accepts any `Future<Output = ()>`, making it easy to integrate with any asynchronous Rust code. |`Task::Task`, `Scheduler::Scheduler::Submit`|
0 commit comments