Description
At the moment, this library isn't fit to be used in async event loop environment such as Amphp or ReactPHP. While it internally uses asynchronous http client, the API itself is not asynchronous.
The HttpTransport
calls wait()
which ofc can't be used in an async event loop.
You could say that I can implement my own HttpTransport but the real problem is the TransportInterface
. Which states that the send method should return either the event id or null on failure. In async environment I of course don't know if it failed or not since I can't wait for it so the interface is effectively impossible to fulfill. The best I can do is to return a Promise<string|null>
.
By reading the documentation that this library isn't tied to any specific http client and that the used http client should be async I was hopeful that it might be fit to be used in async environment too. I'm very disappointed to see that it's actually not the case.