amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

Home Page:https://amphp.org/http-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected behavior: Closing body stream result in an error

Nek- opened this issue · comments

This issue is a follow up on a discussion that occurs on telegram: @trowski specified it should be an issue, so I open one!

It's related to the discussion I already opened here: #363

Using this code:

$this->response->getBody()->close();

Results in an error like the following:

PHP Fatal error:  Uncaught Amp\Pipeline\DisposedException: The iterator has been disposed in vendor/amphp/pipeline/src/Internal/QueueState.php:185

Instead, a cancellation exception is expected.