From f02eab13de8e05e2f44dafad1db1d0b0412a7abf Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Aug 2026 16:30:34 +0200 Subject: [PATCH 1/3] derive async strategies from the ones already configured --- CHANGELOG.md | 6 ++++++ composer.json | 5 +++-- src/Config/Async.php | 33 ++++++++++++--------------------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8552da5..cad00b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### Changed + +- Requires `innmind/http-transport:~9.3` +- Requires `innmind/io:~4.2` +- Requires `innmind/signals:~5.2` + ## 2.1.0 - 2026-08-16 ### Changed diff --git a/composer.json b/composer.json index a49e4bb..03da51c 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,10 @@ "php": "~8.5", "innmind/operating-system": "~7.0", "innmind/immutable": "~6.0", - "innmind/io": "~4.0", + "innmind/http-transport": "~9.3", + "innmind/io": "~4.2", "innmind/time": "~1.0", - "innmind/signals": "~5.0" + "innmind/signals": "~5.2" }, "autoload": { "psr-4": { diff --git a/src/Config/Async.php b/src/Config/Async.php index 0ae532c..5e3e528 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -7,12 +7,8 @@ use Innmind\Signals\Async\Interceptor; use Innmind\Time\{ Clock, - Period, Halt, }; -use Innmind\HttpTransport\Transport; -use Innmind\IO\IO; -use Innmind\Signals\Handler; /** * @internal @@ -30,28 +26,23 @@ private function __construct( public function __invoke(Config $config): Config { - $halt = Halt::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( - $this->clock, - $io, - 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 = Handler::async( - $config->signalsHandler(), + // todo add $config->mapIO() + $io = $config->io()->asAsync($this->clock); + // todo add $config->mapSignals() + $signals = $config->signalsHandler()->asAsync( $this->interceptor, ); return $config - ->haltProcessVia($halt) - ->useHttpTransport($http) ->withIO($io) + ->mapHalt(fn() => Halt::async($this->clock)) + ->mapHttpTransport(fn($transport, $config) => $transport->map( + fn($http) => $http->asAsync( + $this->clock, + $config->halt(), + $config->io(), + ), + )) ->handleSignalsVia($signals); } From c927f1418861b4ed708261b0c06db00e1353a1e4 Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Aug 2026 17:10:29 +0200 Subject: [PATCH 2/3] delay io and signals decorators --- CHANGELOG.md | 2 +- composer.json | 3 +-- src/Config/Async.php | 13 +++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad00b4..a4cc53c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Changed -- Requires `innmind/http-transport:~9.3` +- Requires `innmind/operating-system:~7.3` - Requires `innmind/io:~4.2` - Requires `innmind/signals:~5.2` diff --git a/composer.json b/composer.json index 03da51c..b97eb9a 100644 --- a/composer.json +++ b/composer.json @@ -18,9 +18,8 @@ }, "require": { "php": "~8.5", - "innmind/operating-system": "~7.0", + "innmind/operating-system": "~7.3", "innmind/immutable": "~6.0", - "innmind/http-transport": "~9.3", "innmind/io": "~4.2", "innmind/time": "~1.0", "innmind/signals": "~5.2" diff --git a/src/Config/Async.php b/src/Config/Async.php index 5e3e528..0165a40 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -26,16 +26,9 @@ private function __construct( public function __invoke(Config $config): Config { - // todo add $config->mapIO() - $io = $config->io()->asAsync($this->clock); - // todo add $config->mapSignals() - $signals = $config->signalsHandler()->asAsync( - $this->interceptor, - ); - return $config - ->withIO($io) - ->mapHalt(fn() => Halt::async($this->clock)) + ->mapIO(fn($io) => $io->asAsync($this->clock)) + ->mapHalt(fn($halt) => $halt->asAsync($this->clock)) ->mapHttpTransport(fn($transport, $config) => $transport->map( fn($http) => $http->asAsync( $this->clock, @@ -43,7 +36,7 @@ public function __invoke(Config $config): Config $config->io(), ), )) - ->handleSignalsVia($signals); + ->mapSignalsHandler(fn($signals) => $signals->asAsync($this->interceptor)); } /** From c866397acef520a154355eb3771c77f54668d71e Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Sun, 23 Aug 2026 17:14:36 +0200 Subject: [PATCH 3/3] CS --- src/Config/Async.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Config/Async.php b/src/Config/Async.php index 0165a40..9040b46 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -5,10 +5,7 @@ use Innmind\OperatingSystem\Config; use Innmind\Signals\Async\Interceptor; -use Innmind\Time\{ - Clock, - Halt, -}; +use Innmind\Time\Clock; /** * @internal