Download the PHP package terremoth/php-async without Composer
On this page you can find all versions of the php package terremoth/php-async. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download terremoth/php-async
More information about terremoth/php-async
Files in terremoth/php-async
Package php-async
Short Description Write async PHP processes or process async files with no phtreads, parallel or reactive libs
License GPL-3.0-or-later
Informations about the package php-async
PHP Async Process
Process functions or files async and in parallel without needing AMP, ReactPHP, RxPHP, Spatie/Fork, Fibers, Pthreads, Parallel, Revolt, Pcntl or Swoole.
Just raw PHP! It is magic!
Target Audience
For those who, for some reason, cannot or don't want to use Swoole or Parallel
Why?
- Native way + no need to change php.ini
- Easy: just composer install the lib and use it
- Fast to learn
- Fast to use: no need to compile, no need to download pecl extensions
- Operating system agnostic
How?
It uses a combination of:
- serializable-clojure lib
- Symfony/Process lib
- and PHP's native Shmop extension (available in any platform)
First it serializes your closure with its code,
Then it sends to another background process to execute, through shmop
Some Possible Use Cases
- You got some user data and want to do a heavy processing somewhere without blocking;
- You want to send an email in you own platform without blocking with some data you got before;
- You want to create tons of processes at the same time, not blocking the main process/thread;
- Something will be heavy processed and will took time but your user does not need to know that at the time and don't need/want to wait;
Warning
it does not works on MSYS or MINGW shells! However, It will work fine on both Windows (cmd and powershell) and Linux.
See demos/demo.php for examples.
Installation
Documentation
All versions of php-async with dependencies
symfony/process Version ^7.2
laravel/serializable-closure Version ^2.0
ext-shmop Version *
ext-fileinfo Version *
ext-zlib Version *