diff --git a/composer.json b/composer.json index 394d7e2..604c2ab 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "php": ">=5.4", "evenement/evenement": "^3.0 || ^2.0", "react/event-loop": "^1.2", - "react/http": "^1.6" + "react/http": "^1.6", + "react/promise": "^3 || ^2.10 || ^1.2.1" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.35" diff --git a/src/EventSource.php b/src/EventSource.php index dbfd22e..58e32dc 100644 --- a/src/EventSource.php +++ b/src/EventSource.php @@ -270,6 +270,8 @@ public function close() $request->then(function (ResponseInterface $response) { $response->getBody()->close(); + }, function () { + // ignore to avoid reporting unhandled rejection }); $request->cancel(); }