diff --git a/CHANGELOG.md b/CHANGELOG.md index 8552da5..a4cc53c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### Changed + +- Requires `innmind/operating-system:~7.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..b97eb9a 100644 --- a/composer.json +++ b/composer.json @@ -18,11 +18,11 @@ }, "require": { "php": "~8.5", - "innmind/operating-system": "~7.0", + "innmind/operating-system": "~7.3", "innmind/immutable": "~6.0", - "innmind/io": "~4.0", + "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..9040b46 100644 --- a/src/Config/Async.php +++ b/src/Config/Async.php @@ -5,14 +5,7 @@ use Innmind\OperatingSystem\Config; use Innmind\Signals\Async\Interceptor; -use Innmind\Time\{ - Clock, - Period, - Halt, -}; -use Innmind\HttpTransport\Transport; -use Innmind\IO\IO; -use Innmind\Signals\Handler; +use Innmind\Time\Clock; /** * @internal @@ -30,29 +23,17 @@ 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(), - $this->interceptor, - ); - return $config - ->haltProcessVia($halt) - ->useHttpTransport($http) - ->withIO($io) - ->handleSignalsVia($signals); + ->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, + $config->halt(), + $config->io(), + ), + )) + ->mapSignalsHandler(fn($signals) => $signals->asAsync($this->interceptor)); } /**