An open API service providing repository metadata for many open source software ecosystems.

๐ŸŒ‰ Bridging ext-parallel and ReactPHP

Releases
2.1.0

2.1.0

2.1.0

  • Total issues resolved: 0
  • Total pull requests resolved: 1
  • Total contributors: 1

Dependencies ๐Ÿ“ฆ

9 months ago
Download
2.0.0

2.0.0

Fully reworked the public facing API to utilize fibers:

From:

<?php


use PackageVersions\Versions;
use ReactventLoop\Factory;
use ReactParallel\Factory as ParallelFactory;
use ReactParallel\ObjectProxy\Generated\Proxies\WyriHaximus\Metrics\Registry as RegistryProxy;
use WyriHaximus\Metrics\Label;
use function React\Promisell;
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.";
            }
            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 ReactventLoop\Loop;
use ReactParallel\Factory as ParallelFactory;
use function React\Asyncsync;

$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.";
            }
            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 ๐Ÿ—

Dependencies ๐Ÿ“ฆ,Enhancement โœจ

Dependencies ๐Ÿ“ฆ

Enhancement โœจ

about 1 year ago
Download
1.1.0

1.1.0

Metrics

This release adds supports for metrics through wyrihaximus/metrics:

use ReactventLoop\Factory as EventLoopFactory;
use ReactParallel\Factory;
use ReactParallel\Metrics;
use WyriHaximus\Metrics\Configuration;
use WyriHaximus\Metrics\InMemory\Registry;

$loop = EventLoopFactory::create();
$registry = new Registry(Configuration::create());
$factory = (new Factory($loop))->withMetrics(Metrics::create($registry));

1.1.0

  • Total issues resolved: 0
  • Total pull requests resolved: 4
  • Total contributors: 2

Dependencies ๐Ÿ“ฆ,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,PHP ๐Ÿ˜

Dependencies ๐Ÿ“ฆ,PHP ๐Ÿ˜

Dependencies ๐Ÿ“ฆ,Documentation ๐Ÿ“š,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,PHP ๐Ÿ˜

Dependencies ๐Ÿ“ฆ,Documentation ๐Ÿ“š,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,MarkDown ๐Ÿ“,PHP ๐Ÿ˜,Source ๐Ÿ”ฎ,Tests ๐Ÿงช

over 5 years ago
Download
1.0.0

1.0.0

1.0.0

  • Total issues resolved: 0
  • Total pull requests resolved: 10
  • Total contributors: 1

Documentation ๐Ÿ“š,MarkDown ๐Ÿ“

Dependencies ๐Ÿ“ฆ,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,PHP ๐Ÿ˜

Dependencies ๐Ÿ“ฆ,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,PHP ๐Ÿ˜,Source ๐Ÿ”ฎ

Dependencies ๐Ÿ“ฆ,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,PHP ๐Ÿ˜,Source ๐Ÿ”ฎ,Tests ๐Ÿงช

PHP ๐Ÿ˜,Source ๐Ÿ”ฎ,Tests ๐Ÿงช

CI ๐Ÿšง,Configuration โš™,YAML ๐Ÿ„

Dependencies ๐Ÿ“ฆ,JSON ๐Ÿ‘จโ€๐Ÿ’ผ,NEON ๐Ÿฆนโ€โ™‚๏ธ,PHP ๐Ÿ˜,Source ๐Ÿ”ฎ,Tests ๐Ÿงช

over 5 years ago
Download
Links
Repository Details
  • Stars 15
  • Forks 1
  • Open issues 6
  • License mit
  • Language Makefile
  • Size 896 KB
  • Created at almost 6 years ago
  • Updated at 2 months ago
  • Pushed at 8 days ago
  • Last synced at 8 days ago
  • Dependencies parsed at Pending
Commit Stats