PHPackages                             agussuroyo/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. agussuroyo/async

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

agussuroyo/async
================

A simple asynchronous process manager for PHP using pcntl.

1.0.0(1y ago)02MITPHPPHP &gt;=7.4CI passing

Since Mar 19Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Async Process Manager
=====================

[](#async-process-manager)

[![GitHub Workflow Status on master Branch](https://github.com/agussuroyo/async/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/agussuroyo/async/actions/workflows/test.yml/badge.svg?branch=master)

A lightweight and efficient PHP package to manage asynchronous processes with a configurable process limit.

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

[](#installation)

Install via Composer:

```
composer require agussuroyo/async

```

Features
--------

[](#features)

- Asynchronous process execution with `pcntl_fork`
- Configurable maximum number of parallel processes
- Automatic CPU core detection for optimal performance
- Efficient child process management

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

```
use AgusSuroyo\Async\Async;

$async = new Async();

$async->run(function () {
    sleep(2);
    echo "Process 1 done\n";
});

$async->run(function () {
    sleep(3);
    echo "Process 2 done\n";
});

$async->wait();
```

### Setting Maximum Concurrent Processes

[](#setting-maximum-concurrent-processes)

```
$async = new Async(2); // Limit to 2 concurrent processes
```

### Dynamic Max Process Control

[](#dynamic-max-process-control)

```
$async = new Async();
$async->max(4); // Adjust max processes at runtime
```

Testing
-------

[](#testing)

Run the tests using PHPUnit:

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit a pull request or open an issue.

License
-------

[](#license)

This package is open-source and available under the MIT License.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance45

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c4ff9c71f1c9fa742c2c852482bb72be37a5f32768434b8f4ce2a828e8fe41d?d=identicon)[agussuroyo](/maintainers/agussuroyo)

---

Top Contributors

[![agussuroyo](https://avatars.githubusercontent.com/u/5734710?v=4)](https://github.com/agussuroyo "agussuroyo (17 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/agussuroyo-async/health.svg)

```
[![Health](https://phpackages.com/badges/agussuroyo-async/health.svg)](https://phpackages.com/packages/agussuroyo-async)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
