6dreams / parallel-pool
以池的形式展示并行功能
1.1.4
2019-12-13 10:39 UTC
Requires
- php: >=7.2
Requires (Dev)
- phpunit/phpunit: 8.2.2
README
在并行方式中提供类似于pthread的池接口。
用法
$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); }