PHPackages                             globus-studio/async - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. globus-studio/async

ActiveLibrary[Queues &amp; Workers](/categories/queues)

globus-studio/async
===================

Promise-style asynchronous programming for PHP, built on Revolt fibers and the event loop.

v1.0.0(1mo ago)204MITPHPPHP &gt;=8.1CI passing

Since Apr 26Pushed 1mo ago14 watchersCompare

[ Source](https://github.com/GLOBUS-studio/PHP-Async)[ Packagist](https://packagist.org/packages/globus-studio/async)[ RSS](/packages/globus-studio-async/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

PHP-Async
=========

[](#php-async)

[![CI](https://github.com/GLOBUS-studio/PHP-Async/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/GLOBUS-studio/PHP-Async/actions/workflows/ci.yml)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://www.php.net/)

Promise-style asynchronous programming for PHP, built on top of [Revolt](https://revolt.run/)fibers and the event loop. Concurrency without `pthreads`, without `pcntl_fork`, and without blocking `sleep()`.

Features
--------

[](#features)

- **`async` / `await`** semantics on top of native PHP fibers.
- **Non-blocking** `delay()` powered by Revolt's event loop.
- **Promise combinators**: `Async::all()`, `Async::race()`, `Async::any()`.
- **Timeouts** via `timeout()` that schedules a real loop timer.
- **Cooperative cancellation** with a dedicated `CancelledException`.
- **Event hooks**: `then`, `catch`, `finally`, `progress`, plus arbitrary custom events through `on()`.
- **Priority queue** via `AsyncManager` for batched work.
- **PSR-4**, strict types, fully tested with PHPUnit.

Requirements
------------

[](#requirements)

- PHP **8.1** or newer (Fibers).
- [`revolt/event-loop`](https://packagist.org/packages/revolt/event-loop) `^1.0`.

Installation
------------

[](#installation)

```
composer require globus-studio/async
```

Quick start
-----------

[](#quick-start)

```
