With the current Http client, there are 2 (and maybe more) cases causing a file descriptor leak.
Consider the following code :
$http = new \Rxnet\Http\Http();
$http->get("http://localhost:8282/")
->subscribe(new StdoutObserver(), $scheduler)
We need to control connect timeout and response timeout.
Currently, the only way to handle this is by using the timeout() operator on the Observable returned by the get() method, like this :
$http = new \Rxnet\Http\Http();
$http->get("http://localhost:8282/")
->timeout(1000)
->subscribe(new StdoutObserver(), $scheduler)
But when the timeout is triggered, there is no way to close the file descriptor opened by the http client.
If a process make a lot of http requests, it leads to a FD leak very fast.
I see 2 solutions here :
Add options to control the connect timeout and response timeout in the $opts argument of the request() method, and handle the timeout inside the http client.
Return something that implements DisposableInterface, to control the timeout from outside.
Any thoughts on the solution to implement ? You're welcome :)
With the current Http client, there are 2 (and maybe more) cases causing a file descriptor leak.
Consider the following code :
We need to control connect timeout and response timeout.
Currently, the only way to handle this is by using the timeout() operator on the Observable returned by the get() method, like this :
But when the timeout is triggered, there is no way to close the file descriptor opened by the http client. If a process make a lot of http requests, it leads to a FD leak very fast.
I see 2 solutions here :
Any thoughts on the solution to implement ? You're welcome :)