Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@dbu dbu released this 14 Nov 12:31
4.0.0

With this release the promise wait function will wait for requests to complete using
react/async's await utilizing fibers. Instead of constantly
start stopping the event loop. As such users are expected to run usage of this adapter in a fiber using
react/async's async like:

use function React\Async\async;

async(static function () {
    // Returns a Http\Promise\Promise
    $promise = $adapter->sendAsyncRequest(request);

    // Returns a Psr\Http\Message\ResponseInterface
    $response = $promise->wait();
})();

Another major change in this release is that you no longer inject the event loop into the client. It now
only uses the global loop accessor. This ensures the same event loop is used everywhere and makes creating
the client a bit simpler:

use Http\Adapter\React\ReactFactory;

$reactHttp = ReactFactory::buildHttpClient();

Changed

  • Removed injecting of the event loop and fully switched to using the global loop accessor (Loop::get())
  • Use PHP 8.1 fibers as async mechanism.
  • Detect supported PHP versions in range during CI instead of hardcoding them.