6dreams / parallel-pool
Presents parallel functionality as pool
Installs: 784
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 3
Open Issues: 1
pkg:composer/6dreams/parallel-pool
Requires
- php: >=7.2
Requires (Dev)
- phpunit/phpunit: 8.2.2
README
Provides simmular pool interface in parallel as pthreads.
Usage
$pool = new Pool( __DIR__ . '/bootstrap_or_autoloader.php', 2, static function (ThreadConfigInterface $config) { echo $config->getId() . "\n"; } ); $pool->submit([]); $pool->submit([]); $pool->submit([]); $pool->submit([]); $pool->submit([]); while ($pool->collect()) { \usleep(0); }