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

About

PD\Async is a PHP library using ReactPHP to perform asynchronous tasks, supporting task dependency handling and topological sorting.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

PD\Async is a PHP library using ReactPHP to perform asynchronous tasks, supporting task dependency handling and topological sorting.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages