Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Timeout support (connect and execution) #28
For comparison curl provides you with two options:
Both of these I'm currently using to "probe" ~150 servers per day and test their connect and response time. Since this is about speed, I'm not interested in keeping the connection open for more than a couple of seconds, so I would like to tweak both these parameters.
I'm all for adding support for connection timeout handling!
However, I'm not sure how the "execution timeout" applies in the context of this library (rather low-level connection establishment). Can you explain what you're referring to with "execution" timeout (or "the time the total execution of the request is allowed to take").
Thanks for summing this up @afk11! Indeed, there are quite a few open tickets that deal with connection timeouts (and probably many more we're not even aware of).
For this reason, I've started working on a very simple low-level timeout library (https://github.com/clue/php-promise-timeout). This library can easily be embedded in order to add timeout support to pretty much any Promise-based API.
In this particular case, here's a prototype for how this could be used in this library (dedicated
Open issue before I feel comfortable filing a PR is where this library should live. IMO it should be part of the ReactPHP namespace, so here's a ticket for discussing this further: reactphp/promise-timer#2
Any input is welcome!