Last updated: 2026-10-25
DECLARE THE DEPENDENCIES, LET THE PROMISES RUN THEM!
A PHP library with ReactPHP promise orchestration, declarative task dependencies, and circular dependency detection
composer require pardnchiu/async· Documentation
- Declarative Task Dependencies — Describe each task and its prerequisites in a plain array instead of wiring promise chains by hand.
- Circular Dependency Detection — A depth-first walk checks the dependency graph before any task is created and throws an exception naming the offending task.
- One Promise for All Results — Every task resolves into a single ReactPHP promise that yields a result array keyed by task name.
- Automatic Error Propagation — Any task that throws rejects its own promise and routes the whole run into the catch branch.
- Minimal Footprint — One static method, only react/promise and react/event-loop as dependencies, and PHP 7.4+ support.
graph TB
A[Task Definition Array] --> B[Async::run]
B --> C[Dependency Graph Build]
C --> D[Topological Sort / Cycle Check]
D --> E[Deferred Promise Creation]
E --> F[Promise\all Aggregation]
F --> G[Result Array / Exception]
This project is licensed under the MIT LICENSE.
Just open an issue to share an idea.
©️ 2024 邱敬幃 Pardn Chiu