Download the PHP package symplely/processor without Composer
On this page you can find all versions of the php package symplely/processor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symplely/processor
More information about symplely/processor
Files in symplely/processor
Package processor
Short Description An Symfony Process Manager offering Parallel and asynchronous PHP for Blocking I/O.
License MIT
Homepage https://github.com/symplely/processor
Informations about the package processor
Processor
An simply process manager wrapper API for symfony/process to execute and manage sub-processes.
It's an alternative to pcntl-extension, when not installed. This is part of our symplely/coroutine package for handling any blocking i/o process not handle by Coroutine natively.
The library is to provide an easy to use API to control/manage sub processes for windows OS, and other systems, without any additional software extensions installed.
Installation
Usage
Channel - Transfer messages between a Process
Event hooks
When creating asynchronous processes, you'll get an instance of LauncherInterface
returned.
You can add the following event hooks on a process.
There also ->done
, part of ->then()
extended callback method.
Error handling
If an Exception
or Error
is thrown from within a child process, it can be caught per process by specifying a callback in the ->catch()
method.
If there's no error handler added, the error will be thrown in the parent process when calling spawn_run()
or $process->run()
.
If the child process would unexpectedly stop without throwing an Throwable
, the output written to stderr
will be wrapped and thrown as Async\Processor\ProcessorError
in the parent process.
Contributing
Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on Github :) Create Github Issues for bugs and new features and comment on the ones you are interested in.
License
The MIT License (MIT). Please see License File for more information.