Skip to content
This repository was archived by the owner on Oct 25, 2026. It is now read-only.

Latest commit

 

History

History
66 lines (45 loc) · 2.4 KB

README.md

File metadata and controls

66 lines (45 loc) · 2.4 KB

Last updated: 2026-10-25

Note

This README was generated by SKILL, get the ZH version from here.


DECLARE THE DEPENDENCIES, LET THE PROMISES RUN THEM!

Packagist License


A PHP library with ReactPHP promise orchestration, declarative task dependencies, and circular dependency detection

Table of Contents

Features

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.

Architecture

Full Architecture

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]
Loading

License

This project is licensed under the MIT LICENSE.

Author

Just open an issue to share an idea.

php-async contributors

©️ 2024 邱敬幃 Pardn Chiu