From f016eba8c928671de0cff7bb1abc7d8e53d3b06a Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Nov 2025 16:44:27 +0100 Subject: [PATCH 1/8] require php 8.4 --- .github/workflows/ci.yml | 10 ++++------ CHANGELOG.md | 7 +++++++ composer.json | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 189105d..779f162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,11 @@ on: [push, pull_request] jobs: blackbox: - uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@main + uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@next coverage: - uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main + uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@next secrets: inherit psalm: - uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main + uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@next cs: - uses: innmind/github-workflows/.github/workflows/cs.yml@main - with: - php-version: '8.2' + uses: innmind/github-workflows/.github/workflows/cs.yml@next diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..90962c1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [Unreleased] + +### Changed + +- Requires PHP `8.4` diff --git a/composer.json b/composer.json index 9bb7604..1268766 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "issues": "http://github.com/innmind/async/issues" }, "require": { - "php": "~8.2", + "php": "~8.4", "innmind/operating-system": "~6.2", "innmind/immutable": "~5.18", "innmind/io": "^3.5.1", From 1653f447b79bc96e3cd739e86e7590e1c3e2f41e Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Nov 2025 16:53:45 +0100 Subject: [PATCH 2/8] update dependencies --- composer.json | 22 +++++++++++++++++----- proofs/functional.php | 2 +- src/Config/Async.php | 15 ++++++--------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 1268766..6601b8d 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,23 @@ }, "require": { "php": "~8.4", - "innmind/operating-system": "~6.2", - "innmind/immutable": "~5.18", - "innmind/io": "^3.5.1", - "innmind/time-warp": "^4.1.1", - "innmind/signals": "^4.1.1" + "innmind/operating-system": "dev-next", + "innmind/immutable": "dev-next", + "innmind/io": "dev-next", + "innmind/time-warp": "dev-next", + "innmind/signals": "dev-next", + "innmind/file-watch": "dev-next", + "innmind/server-status": "dev-next", + "innmind/http-transport": "dev-next", + "innmind/http": "dev-next", + "innmind/server-control": "dev-next", + "innmind/filesystem": "dev-next", + "innmind/media-type": "dev-next", + "innmind/validation": "dev-next", + "innmind/url": "dev-next", + "innmind/ip": "dev-next", + "innmind/time-continuum": "dev-next", + "formal/access-layer": "dev-next" }, "autoload": { "psr-4": { diff --git a/proofs/functional.php b/proofs/functional.php index ebae093..24751dc 100644 --- a/proofs/functional.php +++ b/proofs/functional.php @@ -466,7 +466,7 @@ static function($assert) { ->wakeOnResult(), ); - $assert->count(0, $results); + $assert->same(0, $results->size()); }, ); diff --git a/src/Config/Async.php b/src/Config/Async.php index e9e636c..e453f3b 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -9,7 +9,7 @@ Clock, Period, }; -use Innmind\HttpTransport\Curl; +use Innmind\HttpTransport\Transport; use Innmind\TimeWarp\Halt; use Innmind\IO\IO; @@ -29,19 +29,16 @@ private function __construct( public function __invoke(Config $config): Config { - $halt = Halt\Async::of($this->clock); + $halt = Halt::async($this->clock); $io = IO::async($this->clock); - // todo handle max concurrency + ssl configuration // todo build a native client based on innmind/io to better integrate in // this system. - $http = Curl::of( + $http = Transport::async( $this->clock, $io, - ) - ->heartbeat( - Period::millisecond(10), // this is blocking the active task so it needs to be low - static fn() => $halt(Period::millisecond(1))->unwrap(), // this allows to jump between tasks - ); + Period::millisecond(10), // this is blocking the active task so it needs to be low + static fn() => $halt(Period::millisecond(1))->unwrap(), // this allows to jump between tasks + ); $signals = $config ->signalsHandler() ->async($this->interceptor); From c5be5d0633d5d3483e0b3c8b3a0f845d2ab2185c Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Thu, 11 Dec 2025 14:02:00 +0100 Subject: [PATCH 3/8] remove warnings --- proofs/functional.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/proofs/functional.php b/proofs/functional.php index 24751dc..ed96615 100644 --- a/proofs/functional.php +++ b/proofs/functional.php @@ -111,23 +111,23 @@ static function($assert) { [false, 0] => $continuation ->schedule(Sequence::of( static function($os) { - $os->process()->halt(Period::second(1))->unwrap(); - $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); }, static function($os) { - $os->process()->halt(Period::second(1))->unwrap(); - $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); }, static function($os) { - $os->process()->halt(Period::second(1))->unwrap(); - $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); }, )) ->carryWith(true), [true, 0] => (static function($os, $continuation) { // this halt is executed at the same time at the // second one in each task - $os->process()->halt(Period::second(1))->unwrap(); + $_ = $os->process()->halt(Period::second(1))->unwrap(); return $continuation; })($os, $continuation), @@ -154,7 +154,7 @@ static function($assert) { ->with( static function($started, $os, $continuation) use ($assert, &$results) { if ($started) { - $os + $_ = $os ->process() ->halt(Period::second(2)) ->unwrap(); @@ -170,14 +170,14 @@ static function($os) use (&$results) { // This task halts for 4 seconds because // if less then it may sometime finish // before the scope. (as 3-1 ~= 2s) - $os + $_ = $os ->process() ->halt(Period::second(4)) ->unwrap(); $results[] = 'task 1'; }, static function($os) use (&$results) { - $os + $_ = $os ->process() ->halt(Period::second(1)) ->unwrap(); @@ -210,11 +210,11 @@ static function($assert) { ->with( static function($started, $os, $continuation) use ($assert, &$results) { if ($started) { - $os + $_ = $os ->process() ->halt(Period::second(3)) ->unwrap(); - $os + $_ = $os ->process() ->halt(Period::second(1)) ->unwrap(); @@ -227,14 +227,14 @@ static function($started, $os, $continuation) use ($assert, &$results) { ->carryWith(true) ->schedule(Sequence::of( static function($os) use (&$results) { - $os + $_ = $os ->process() ->halt(Period::second(2)) ->unwrap(); $results[] = 'task 1'; }, static function($os) use (&$results) { - $os + $_ = $os ->process() ->halt(Period::second(1)) ->unwrap(); @@ -411,7 +411,7 @@ static function($_, $__, $continuation) use ($assert, &$order) { return $continuation ->schedule(Sequence::of( static function($os) use ($assert, &$order) { - $os + $_ = $os ->remote() ->http()(Request::of( Url::of('https://httpbun.org/delay/2'), @@ -425,7 +425,7 @@ static function($os) use ($assert, &$order) { $order[] = 'first'; }, static function($os) use ($assert, &$order) { - $os + $_ = $os ->remote() ->http()(Request::of( Url::of('https://httpbun.org/delay/1'), @@ -533,7 +533,7 @@ static function() use (&$continue) { ); while ($continue) { - $os + $_ = $os ->process() ->halt(Period::second(2)) ->unwrap(); @@ -542,7 +542,7 @@ static function() use (&$continue) { )); } - $os + $_ = $os ->process() ->halt(Period::second(1)) ->unwrap(); From 7788f8a4b5873d7024a17979cbc94fb895a5033c Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Thu, 11 Dec 2025 14:04:01 +0100 Subject: [PATCH 4/8] update the way to build async io and signals wrappers --- src/Config/Async.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Config/Async.php b/src/Config/Async.php index e453f3b..bade2cd 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -12,6 +12,7 @@ use Innmind\HttpTransport\Transport; use Innmind\TimeWarp\Halt; use Innmind\IO\IO; +use Innmind\Signals\Handler; /** * @internal @@ -30,7 +31,10 @@ private function __construct( public function __invoke(Config $config): Config { $halt = Halt::async($this->clock); - $io = IO::async($this->clock); + $io = IO::async( + $config->io(), + $this->clock, + ); // todo build a native client based on innmind/io to better integrate in // this system. $http = Transport::async( @@ -39,9 +43,10 @@ public function __invoke(Config $config): Config Period::millisecond(10), // this is blocking the active task so it needs to be low static fn() => $halt(Period::millisecond(1))->unwrap(), // this allows to jump between tasks ); - $signals = $config - ->signalsHandler() - ->async($this->interceptor); + $signals = Handler::async( + $config->signalsHandler(), + $this->interceptor, + ); return $config ->haltProcessVia($halt) From 442f5a96991dece9befad0c781c897ca2a3d6296 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 8 Feb 2026 12:21:47 +0100 Subject: [PATCH 5/8] tag dependencies --- .github/workflows/ci.yml | 8 ++++---- CHANGELOG.md | 2 ++ composer.json | 24 ++++++------------------ proofs/functional.php | 7 ++++--- src/Config/Async.php | 4 ++-- src/Config/Provider.php | 2 +- src/Resumption.php | 2 +- src/Scope/Suspended.php | 2 +- src/Suspension.php | 4 ++-- src/Task/Suspended.php | 2 +- src/Wait.php | 2 +- 11 files changed, 25 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 779f162..2f3eecb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,11 +4,11 @@ on: [push, pull_request] jobs: blackbox: - uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@next + uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@main coverage: - uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@next + uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main secrets: inherit psalm: - uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@next + uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main cs: - uses: innmind/github-workflows/.github/workflows/cs.yml@next + uses: innmind/github-workflows/.github/workflows/cs.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 90962c1..933b1af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,5 @@ ### Changed - Requires PHP `8.4` +- Requires `innmind/operating-system:~7.0` +- Requires `innmind/time:~1.0` diff --git a/composer.json b/composer.json index 6601b8d..e55e612 100644 --- a/composer.json +++ b/composer.json @@ -16,23 +16,11 @@ }, "require": { "php": "~8.4", - "innmind/operating-system": "dev-next", - "innmind/immutable": "dev-next", - "innmind/io": "dev-next", - "innmind/time-warp": "dev-next", - "innmind/signals": "dev-next", - "innmind/file-watch": "dev-next", - "innmind/server-status": "dev-next", - "innmind/http-transport": "dev-next", - "innmind/http": "dev-next", - "innmind/server-control": "dev-next", - "innmind/filesystem": "dev-next", - "innmind/media-type": "dev-next", - "innmind/validation": "dev-next", - "innmind/url": "dev-next", - "innmind/ip": "dev-next", - "innmind/time-continuum": "dev-next", - "formal/access-layer": "dev-next" + "innmind/operating-system": "~7.0", + "innmind/immutable": "~6.0", + "innmind/io": "~4.0", + "innmind/time": "~1.0", + "innmind/signals": "~5.0" }, "autoload": { "psr-4": { @@ -40,7 +28,7 @@ } }, "require-dev": { - "innmind/static-analysis": "^1.2.1", + "innmind/static-analysis": "~1.3", "innmind/black-box": "~6.5", "innmind/coding-standard": "~2.0" } diff --git a/proofs/functional.php b/proofs/functional.php index ed96615..fef1da8 100644 --- a/proofs/functional.php +++ b/proofs/functional.php @@ -7,7 +7,7 @@ }; use Innmind\OperatingSystem\Factory; use Innmind\Signals\Signal; -use Innmind\TimeContinuum\Period; +use Innmind\Time\Period; use Innmind\Filesystem\Name; use Innmind\Http\{ Request, @@ -522,7 +522,7 @@ static function($started, $os, $continuation) { 10, static function($os) { $continue = true; - $os + $_ = $os ->process() ->signals() ->listen( @@ -530,7 +530,8 @@ static function($os) { static function() use (&$continue) { $continue = false; }, - ); + ) + ->unwrap(); while ($continue) { $_ = $os diff --git a/src/Config/Async.php b/src/Config/Async.php index bade2cd..0ae532c 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -5,12 +5,12 @@ use Innmind\OperatingSystem\Config; use Innmind\Signals\Async\Interceptor; -use Innmind\TimeContinuum\{ +use Innmind\Time\{ Clock, Period, + Halt, }; use Innmind\HttpTransport\Transport; -use Innmind\TimeWarp\Halt; use Innmind\IO\IO; use Innmind\Signals\Handler; diff --git a/src/Config/Provider.php b/src/Config/Provider.php index b4e5166..02171fe 100644 --- a/src/Config/Provider.php +++ b/src/Config/Provider.php @@ -4,7 +4,7 @@ namespace Innmind\Async\Config; use Innmind\Signals\Async\Interceptor; -use Innmind\TimeContinuum\Clock; +use Innmind\Time\Clock; /** * @internal diff --git a/src/Resumption.php b/src/Resumption.php index 1a72537..376820f 100644 --- a/src/Resumption.php +++ b/src/Resumption.php @@ -3,7 +3,7 @@ namespace Innmind\Async; -use Innmind\TimeWarp\Async\Resumable as Halt; +use Innmind\Time\Halt\Async\Resumable as Halt; use Innmind\IO\Internal\Async\Resumable as IO; /** diff --git a/src/Scope/Suspended.php b/src/Scope/Suspended.php index b25c57a..49f9025 100644 --- a/src/Scope/Suspended.php +++ b/src/Scope/Suspended.php @@ -8,7 +8,7 @@ Suspension, Wait, }; -use Innmind\TimeContinuum\Clock; +use Innmind\Time\Clock; /** * Waiting for IO to be ready or halt to be finished diff --git a/src/Suspension.php b/src/Suspension.php index 7281861..1febed6 100644 --- a/src/Suspension.php +++ b/src/Suspension.php @@ -3,11 +3,11 @@ namespace Innmind\Async; -use Innmind\TimeContinuum\{ +use Innmind\Time\{ Clock, Period, + Halt\Async\Suspended as Halt, }; -use Innmind\TimeWarp\Async\Suspended as Halt; use Innmind\IO\Internal\{ Async\Suspended as IO, Watch, diff --git a/src/Task/Suspended.php b/src/Task/Suspended.php index 1abd89b..06cec7e 100644 --- a/src/Task/Suspended.php +++ b/src/Task/Suspended.php @@ -11,7 +11,7 @@ Async\Interceptor, Signal, }; -use Innmind\TimeContinuum\Clock; +use Innmind\Time\Clock; /** * Waiting for IO to be ready or halt to be finished diff --git a/src/Wait.php b/src/Wait.php index f441c8f..5d9e021 100644 --- a/src/Wait.php +++ b/src/Wait.php @@ -4,7 +4,7 @@ namespace Innmind\Async; use Innmind\OperatingSystem\OperatingSystem; -use Innmind\TimeContinuum\Period; +use Innmind\Time\Period; use Innmind\IO\Internal\Watch; /** From 7847f495a3e446c396d80789d0aa1a246a7fac41 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 8 Feb 2026 12:29:08 +0100 Subject: [PATCH 6/8] use resilient os as httpbun sometimes fail --- proofs/functional.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proofs/functional.php b/proofs/functional.php index fef1da8..9c1988d 100644 --- a/proofs/functional.php +++ b/proofs/functional.php @@ -5,7 +5,10 @@ Scheduler, Task, }; -use Innmind\OperatingSystem\Factory; +use Innmind\OperatingSystem\{ + Factory, + Config\Resilient, +}; use Innmind\Signals\Signal; use Innmind\Time\Period; use Innmind\Filesystem\Name; @@ -404,7 +407,7 @@ static function($os) use ($assert, &$chunks) { 'HTTP requests are handled asynchronously', static function($assert) { $order = []; - Scheduler::of(Factory::build()) + Scheduler::of(Factory::build()->map(Resilient::new())) ->sink(null) ->with( static function($_, $__, $continuation) use ($assert, &$order) { From ade0ea790230120edc89b5b2eecce5a56075aa0b Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 8 Feb 2026 12:31:10 +0100 Subject: [PATCH 7/8] increase delay to avoid latency affecting the result --- proofs/functional.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proofs/functional.php b/proofs/functional.php index 9c1988d..4428b50 100644 --- a/proofs/functional.php +++ b/proofs/functional.php @@ -417,7 +417,7 @@ static function($os) use ($assert, &$order) { $_ = $os ->remote() ->http()(Request::of( - Url::of('https://httpbun.org/delay/2'), + Url::of('https://httpbun.org/delay/5'), Method::get, ProtocolVersion::v11, )) From 391d991f4fb60d71a3b69377d84c8f541207888d Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 8 Feb 2026 12:34:11 +0100 Subject: [PATCH 8/8] switch to httpbin --- proofs/functional.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proofs/functional.php b/proofs/functional.php index 4428b50..8058859 100644 --- a/proofs/functional.php +++ b/proofs/functional.php @@ -417,7 +417,7 @@ static function($os) use ($assert, &$order) { $_ = $os ->remote() ->http()(Request::of( - Url::of('https://httpbun.org/delay/5'), + Url::of('https://httpbin.org/delay/5'), Method::get, ProtocolVersion::v11, )) @@ -431,7 +431,7 @@ static function($os) use ($assert, &$order) { $_ = $os ->remote() ->http()(Request::of( - Url::of('https://httpbun.org/delay/1'), + Url::of('https://httpbin.org/delay/1'), Method::get, ProtocolVersion::v11, ))