Download the PHP package krowinski/async without Composer
On this page you can find all versions of the php package krowinski/async. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package async
async
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 ?
- 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 ?
- Calling exec is slower then fork
- Some resource/function/data must be passed directly to closure
Some research
- https://www.phproundtable.com/episode/asynchronous-php - good start to "know how" make php async
- https://amphp.org/ - non-blocking framework for PHP
Example ?
Sure take a look - https://github.com/krowinski/async/blob/master/example/example.php
User cases (mostly some code on website that user don't need to wait for)
- send callback
- publish to queue amqp
- send external analytic data
- remove files
- process payments
Supports M$ Windows?
NO.
TODO
- tests
All versions of async with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1
ext-pcntl Version *
symfony/process Version ^4.0|^5.0
symfony/console Version ^4.0|^5.0
jeremeamia/superclosure Version ^2.4
ext-pcntl Version *
symfony/process Version ^4.0|^5.0
symfony/console Version ^4.0|^5.0
jeremeamia/superclosure Version ^2.4
The package krowinski/async contains the following files
Loading the files please wait ....