Download the PHP package dan-rogers/threadpool without Composer
On this page you can find all versions of the php package dan-rogers/threadpool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dan-rogers/threadpool
More information about dan-rogers/threadpool
Files in dan-rogers/threadpool
Download dan-rogers/threadpool
More information about dan-rogers/threadpool
Files in dan-rogers/threadpool
Vendor dan-rogers
Package threadpool
Short Description A very basic implementation of a worker pool in PHP for shell applications
License Apache-2.0
Package threadpool
Short Description A very basic implementation of a worker pool in PHP for shell applications
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package threadpool
php-threadpool
A simplistic approach to a threadpool in PHP
Installation
Example use case
This implementation is intended for something like the following:
- You have many accounts to process, doing things which take a long time like multiple calls to a slow external API
- Running this in sequence would take too long so you need multiple threads
- The action you are taking is run in a command line script which take arguments
Example implementation
Lets use our above use case. I have 200 user accounts. For each user account I need to pull and save some from an API, process it and dispatch the processed result to another service.
Code for the above process. Lets call the script child-process.php
:
Invoking the above would be as simple as running php child-process.php {account_id}
. In a main script lets use the Threadpool:
All versions of threadpool with dependencies
PHP Build Version
Package Version
The package dan-rogers/threadpool contains the following files
Loading the files please wait ....