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

1.1.4 2019-12-13 10:39 UTC

This package is auto-updated.

Last update: 2025-09-13 23:39:05 UTC


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);
}