Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
*.webp binary
*.bmp binary
*.ttf binary
*.blp binary
*.db2 binary

# Ignoring files for distribution archieves
.github/ export-ignore
etc/ci/ export-ignore
etc/dev-app/ export-ignore
etc/qa/ export-ignore
examples/ export-ignore
tests/ export-ignore
Expand Down
12 changes: 8 additions & 4 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>WyriHaximus/renovate-config:php-package"
]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>WyriHaximus/renovate-config:php-package"
],
"constraints": {
"php": "8.4.x",
"composer": "2.x"
}
}
115 changes: 85 additions & 30 deletions Makefile

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"react-parallel/pool-tests": "^5.1.0 || ^6.0.0",
"react-parallel/stubs": "^1.2.0",
"wyrihaximus/async-test-utilities": "^12.2.0",
"wyrihaximus/makefiles": "^0.7.16"
"wyrihaximus/makefiles": "^0.10.6"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion etc/qa/infection.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"timeout": 1800,
"source": {
"directories": [
"src"
"../../src"
]
},
"logs": {
Expand Down
1 change: 1 addition & 0 deletions etc/qa/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<arg value="np" /> <!-- n = ignore warnings, p = show progress -->

<file>../../etc</file>
<file>../../examples</file>
<file>../../src</file>
<file>../../tests</file>

Expand Down
13 changes: 12 additions & 1 deletion etc/qa/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="../../vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd" cacheDirectory="../../var/phpunit/cache">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="../../vendor/autoload.php"
colors="true"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
cacheDirectory="../../var/phpunit/cache"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnPhpunitDeprecations="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory>../../tests/</directory>
Expand Down
9 changes: 5 additions & 4 deletions examples/echo.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
use ReactParallel\EventLoop\EventLoopBridge;
use ReactParallel\Pool\Infinite\Infinite;
use ReactParallel\Pool\Limited\Limited;

use function React\Async\async;

require __DIR__ . '/../vendor/autoload.php';

$limited = new Limited(
new Infinite(new EventLoopBridge(), 1), // Another pool, preferably an inifinite pool
100 // The amount of threads to start and keep running
100, // The amount of threads to start and keep running
);
$time = time();
$time = time();

Loop::futureTick(async(static function () use ($limited, $time) {
echo 'Unix timestamp: ', $limited->run(function (int $time): int {
Loop::futureTick(async(static function () use ($limited, $time): void {
echo 'Unix timestamp: ', $limited->run(static function (int $time): int {
return $time;
}, [$time]), $time, PHP_EOL;
}));
4 changes: 2 additions & 2 deletions examples/sleep.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

$limited = new Limited(new Infinite(new EventLoopBridge(), 1), 100);

Loop::futureTick(async(static function () use ($limited) {
$timer = Loop::addPeriodicTimer(1, function () use ($limited) {
Loop::futureTick(async(static function () use ($limited): void {
$timer = Loop::addPeriodicTimer(1, static function () use ($limited): void {
var_export(iteratorOrArrayToArray($limited->info()));
});

Expand Down
9 changes: 5 additions & 4 deletions examples/versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
use ReactParallel\EventLoop\EventLoopBridge;
use ReactParallel\Pool\Infinite\Infinite;
use ReactParallel\Pool\Limited\Limited;

use function React\Async\async;

require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

$limited = new Limited(new Infinite(new EventLoopBridge(), 1), 2);

Loop::futureTick(async(static function () use ($limited) {
Loop::futureTick(async(static function () use ($limited): void {
Loop::addTimer(1, static function () use ($limited): void {
$limited->kill();
Loop::stop();
Expand All @@ -27,8 +28,8 @@
$package => InstalledVersions::getPrettyVersion($package),
],
InstalledVersions::getInstalledPackages(),
)
)
)
),
),
),
);
}));
Loading