jinraynor1 / threading
simulate threads
v0.0.2
2019-05-07 21:01 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~6.5
This package is auto-updated.
Last update: 2025-01-08 09:35:20 UTC
README
simulate threads using pcntl posix
- Features:
- Can set queue size
- Can pass messages from childs to parent
Example
$queue = new ThreadQueue(function ($number) { return pow($number, 2); }); $queue->enableMessaging(true); $queue->add(1); $queue->add(3); $queue->wait(); $results = $queue->results(); $sum = array_sum($results); // $sums now holds 9