diff --git a/src/Optimizely/Event/Dispatcher/DefaultEventDispatcher.php b/src/Optimizely/Event/Dispatcher/DefaultEventDispatcher.php index b5b4b7c3..5dcf86b0 100644 --- a/src/Optimizely/Event/Dispatcher/DefaultEventDispatcher.php +++ b/src/Optimizely/Event/Dispatcher/DefaultEventDispatcher.php @@ -50,6 +50,7 @@ public function dispatchEvent(LogEvent $event) 'connect_timeout' => DefaultEventDispatcher::TIMEOUT ]; - $this->httpClient->request($event->getHttpVerb(), $event->getUrl(), $options); + $this->httpClient->requestAsync($event->getHttpVerb(), $event->getUrl(), $options) + ->then(fn($response) => $response); } } diff --git a/tests/EventTests/DefaultEventDispatcherTest.php b/tests/EventTests/DefaultEventDispatcherTest.php index 9b138ce3..960ec1c7 100644 --- a/tests/EventTests/DefaultEventDispatcherTest.php +++ b/tests/EventTests/DefaultEventDispatcherTest.php @@ -49,7 +49,7 @@ public function testDispatchEvent() ->getMock(); $guzzleClientMock->expects($this->once()) - ->method('request') + ->method('requestAsync') ->with($logEvent->getHttpVerb(), $logEvent->getUrl(), $expectedOptions); $eventDispatcher = new DefaultEventDispatcher($guzzleClientMock);