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

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

krowinski/async
===============

Run php closure asynchronously

v2.0.0(6y ago)94333MITPHPPHP &gt;=7.1CI failing

Since Dec 31Pushed 6y ago1 watchersCompare

[ Source](https://github.com/krowinski/async)[ Packagist](https://packagist.org/packages/krowinski/async)[ RSS](/packages/krowinski-async/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

async
=====

[](#async)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b1d99f219303e650c79bb9b69db33e913e77444fe155847956071fc6a305b378/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b726f77696e736b692f6173796e632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/krowinski/async/?branch=master)[![Build Status](https://camo.githubusercontent.com/5a46804fd4629b46d63cc90f662d6996164f869f15e547e111125265a7e382da/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b726f77696e736b692f6173796e632f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/krowinski/async/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/63ff46ac05085bc8215ac509c9264383e14af76c5f562bcd5583ce28987c4d83/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b726f77696e736b692f6173796e632f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/krowinski/async/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/4fbd8ecb61c0fb519ed305422ad8653d7e9d9b384f5ad0022ddcb6e7e93f769b/68747470733a2f2f706f7365722e707567782e6f72672f6b726f77696e736b692f6173796e632f76657273696f6e)](https://packagist.org/packages/krowinski/async)[![Latest Unstable Version](https://camo.githubusercontent.com/e54e6b433226737ffbc4cb788e030ecb075643c0c7cf1b6be6ff933df0605600/68747470733a2f2f706f7365722e707567782e6f72672f6b726f77696e736b692f6173796e632f762f756e737461626c65)](//packagist.org/packages/krowinski/async)[![Total Downloads](https://camo.githubusercontent.com/f73b48279d4edc33b87e8bfcae8304392c10a7ea0317390724492566195a8e85/68747470733a2f2f706f7365722e707567782e6f72672f6b726f77696e736b692f6173796e632f646f776e6c6f616473)](https://packagist.org/packages/krowinski/async)

### How this work?

[](#how-this-work)

Well its basically "exec" with serialised closure. "Dressed" in nice libs like symfony process and console. I serialise callable function and sent to child process by exec. To get callback I register shutdown function and wait for process to finish.

### Why not pcntl ?

[](#why-not-pcntl-)

- Pcntl extension fork, so you can forget using it in web applications like apache2/php-fpm etc its only for CLI
- forks retains the parent state (for example open files) so its problematic

### Problems ?

[](#problems-)

- Calling exec is slower then fork
- Some resource/function/data must be passed directly to closure

### Some research

[](#some-research)

-  - good start to "know how" make php async
-  - non-blocking framework for PHP

### Example ?

[](#example-)

Sure take a look -

### User cases (mostly some code on website that user don't need to wait for)

[](#user-cases-mostly-some-code-on-website-that-user-dont-need-to-wait-for)

- send callback
- publish to queue amqp
- send external analytic data
- remove files
- process payments

### Supports M$ Windows?

[](#supports-m-windows)

NO.

### TODO

[](#todo)

- tests

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~358 days

Total

3

Last Release

2386d ago

Major Versions

v1.0.1 → v2.0.02019-12-18

PHP version history (2 changes)v1.0.0PHP &gt;=5.6

v2.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1478555?v=4)[Kacper Rowiński](/maintainers/krowinski)[@krowinski](https://github.com/krowinski)

---

Top Contributors

[![krowinski](https://avatars.githubusercontent.com/u/1478555?v=4)](https://github.com/krowinski "krowinski (14 commits)")

---

Tags

asyncclosurecomposer-packagesphpprove-of-conceptphpasync

### Embed Badge

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

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)[riki137/multitron

Tool for managing fast both asynchronous and multi-threaded execution of tasks. Focused on performance and pleasant CLI interface.

9117.9k](/packages/riki137-multitron)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4041.4k5](/packages/orisai-scheduler)

PHPackages © 2026

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