2.0.0
Fully reworked the public facing API to utilize fibers:
From:
<?php
use PackageVersions\Versions;
use React�ventLoop\Factory;
use ReactParallel\Factory as ParallelFactory;
use ReactParallel\ObjectProxy\Generated\Proxies\WyriHaximus\Metrics\Registry as RegistryProxy;
use WyriHaximus\Metrics\Label;
use function React\Promise�ll;
use WyriHaximus\React\Parallel\Finite;
use function WyriHaximus\iteratorOrArrayToArray;
use WyriHaximus\React\Parallel\ReturnThread;
use WyriHaximus\React\Parallel\FiniteWorker;
$options = getopt(
'',
[
'iterations:',
'delay::',
],
);
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
$loop = Factory::create();
echo 'Loop: ', get_class($loop), PHP_EOL;
$parallelFactory = new ParallelFactory($loop);
$pool = $parallelFactory->lowLevelPool();
$loop->futureTick(static function () use ($pool, $options): void {
foreach (range(0, 7) as $i) {
$pool->run(static function (int $index, int $iterations, bool $delay): int {
for ($i = 0; $i < $iterations; $i++) {
if ($delay) {
usleep($i * 3.3);
}
echo "�[" . (30 + $index) . ";" . (40 + $index) . "m.�[0m";
}
return true;
}, [$i, (int)$options['iterations'], isset($options['delay'])]);
}
});
echo PHP_EOL, 'Loop::run()', PHP_EOL;
$loop->run();
echo PHP_EOL, 'Loop::done()', PHP_EOL;To:
<?php
declare(strict_types=1);
use React�ventLoop\Loop;
use ReactParallel\Factory as ParallelFactory;
use function React\Async�sync;
$options = getopt(
'',
[
'iterations:',
'delay::',
],
);
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
echo 'Loop: ', Loop::get()::class, PHP_EOL;
$parallelFactory = new ParallelFactory();
$pool = $parallelFactory->lowLevelPool();
foreach (range(0, 7) as $i) {
Loop::futureTick(async(static function () use ($i, $pool, $options): void {
$pool->run(static function (int $index, int $iterations, bool $delay): bool {
for ($i = 0; $i < $iterations; $i++) {
if ($delay) {
usleep((int) ($i * 0.3));
}
echo "�[" . (30 + $index) . ";" . (40 + $index) . "m.�[0m";
}
return true;
}, [$i, (int)$options['iterations'], isset($options['delay'])]);
}));
}
echo PHP_EOL, 'Loop::run()', PHP_EOL;2.0.0
- Total issues resolved: 0
- Total pull requests resolved: 28
- Total contributors: 3
Dependencies 📦,Feature 🏗
- 56: Template types thanks to @WyriHaximus
Dependencies 📦,Enhancement ✨
- 54: Down bump to PHP 8.1 thanks to @WyriHaximus
Dependencies 📦
- 50: Bump composer/composer from 2.6.6 to 2.7.0 thanks to @dependabot[bot]
- 49: PHP 8.2+ thanks to @WyriHaximus
- 48: Update dependency react/http to v1.9.0 [SECURITY] - autoclosed thanks to @renovate[bot]
- 47: Update dependency react/http to v1.9.0 [SECURITY] thanks to @renovate[bot]
- 46: Update github/super-linter Docker tag to v5 - autoclosed thanks to @renovate[bot]
- 44: Update actions/cache action to v3 - autoclosed thanks to @renovate[bot]
- 43: Update JasonEtco/is-sponsor-label-action action to v2 - autoclosed thanks to @renovate[bot]
- 42: Update github/super-linter Docker tag to v2.2.2 - autoclosed thanks to @renovate[bot]
- 41: Update dependency wyrihaximus/metrics to v2 - autoclosed thanks to @renovate[bot]
- 40: Update dependency wyrihaximus/async-test-utilities to v7 - autoclosed thanks to @renovate[bot]
- 39: Update dependency react/promise to v3 - autoclosed thanks to @renovate[bot]
- 38: Update dependency ocramius/package-versions to v2 - autoclosed thanks to @renovate[bot]
- 37: Update dependency moneyphp/money to v4 - autoclosed thanks to @renovate[bot]
- 35: Update dependency react/http to v1.9.0 [SECURITY] thanks to @renovate[bot]
- 33: Update dependency ancarda/psr7-string-stream to v1.3.1 - autoclosed thanks to @renovate[bot]
- 32: Update dependency react/http to v1.9.0 [SECURITY] - autoclosed thanks to @renovate[bot]
- 27: Bump react/http from 1.2.0 to 1.3.0 thanks to @dependabot[bot]
- 25: Bump react-parallel/limited-pool from 1.0.0 to 1.0.1 thanks to @dependabot[bot]
- 24: Bump wyrihaximus/async-test-utilities from 3.3.2 to 3.3.3 thanks to @dependabot[bot]
- 23: Bump wyrihaximus/async-test-utilities from 3.3.1 to 3.3.2 thanks to @dependabot[bot]
- 22: Bump react-parallel/event-loop from 1.1.0 to 1.2.0 thanks to @dependabot[bot]
- 21: Bump wyrihaximus/async-test-utilities from 3.2.0 to 3.3.1 thanks to @dependabot[bot]
- 20: Bump react-parallel/infinite-pool from 2.1.0 to 2.1.2 thanks to @dependabot[bot]
- 19: Bump react/http from 1.1.0 to 1.2.0 thanks to @dependabot[bot]