https://github.com/6dreams/parallel-pool
Provides pthread's pool when using parallel
https://github.com/6dreams/parallel-pool
ext-parallel php pooling
Last synced: about 1 month ago
JSON representation
Provides pthread's pool when using parallel
- Host: GitHub
- URL: https://github.com/6dreams/parallel-pool
- Owner: 6dreams
- Created: 2019-06-07T12:36:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-13T10:39:16.000Z (about 6 years ago)
- Last Synced: 2025-09-29T09:45:35.166Z (5 months ago)
- Topics: ext-parallel, php, pooling
- Language: PHP
- Size: 8.79 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pools in php-parallel extension
Provides simmular pool interface in parallel as pthreads.
## Usage
```php
$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);
}
```