Search by

pardnchiu / async

pardnchiu

This package is abandoned and no longer maintained. No replacement package was suggested.

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

1.0.0 2025-02-02 19:53 UTC

This package is auto-updated.

Last update: 2026-10-25 07:46:05 UTC


README

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