low_ghost / phpmultithread
Minimalistic Multithreading with Coroutines
Installs: 370
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.3.0
- jeremeamia/superclosure: ~1.0.1
- symfony/process: 2.5.*
This package is not auto-updated.
Last update: 2024-11-09 18:43:27 UTC
README
This minimalistic package allows asynchronous multithreading using coroutines and the Symfony/Process component. Coroutine structure based heavily on https://nikic.github.io/2012/12/22/Cooperative-multitasking-using-coroutines-in-PHP.html Basically, for use when you don't have access to reactPhp or other async frameworks, or message queues like Beanstalk or Redis and still want to run non-blocking processes on multiple threads. Supports running php closure functions by passing a closure obj to AsyncTask->create();
See TaskRunnerExample.php for some simple examples.