PHPackages                             fiasco/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fiasco/async

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fiasco/async
============

PHP library for running asynchronous runtime php forks using pcntl.

3.1(4y ago)18.0k↓50%21GPL-3.0-or-laterPHP

Since Mar 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fiasco/async)[ Packagist](https://packagist.org/packages/fiasco/async)[ RSS](/packages/fiasco-async/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelogDependencies (6)Versions (21)Used By (1)

Async
=====

[](#async)

PHP library to execute tasks asynchronously.

This library allows you to hand off anonymous functions to execute in parallel through child forks using the PCNTL extension.

Return values of the anonymous functions are serialized and returned to the the parent fork to process.

**Note:** Objects that cannot be serialized are not supported as return values.

**Note:** As Exception objects can contain objects in their stack trace that cannot be serialized, it is not recommended use them as return values for the onSuccess callback function.

If you're wanting to run asynchronous activities like requests file operations or server interaction, consider [ReactPHP](https://reactphp.org) instead (which this library relies upon).

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

[](#installation)

Recommended installation method via composer.

```
composer require fiasco/async:^3.0

```

Usage
-----

[](#usage)

See [examples](examples).

Use the fork manager to create forks to execute in parallel.

```
