Comments (6)
This feature has been started in the underlying library reactphp-legacy/socket-client#10. Once it's implemented there it should be simple enough to add here.
from http-client.
π on supporting a timeout setting.
Though I'm not sure what the API could look likeβ¦
Also, when should we actually time out (connection timeout, whole request timeout, idle timeout etcβ¦)?
I think it makes sense to add an API similar to reactphp-legacy/socket-client#10. Any thoughts on this @Renegade334?
from http-client.
Clients like cURL support both a connection timeout and a total timeout. Both would be useful, IMO, although I was originally thinking of total timeout when submitting this. The latter would be a client-level feature, I guess, whereas the former would be socket-level.
renegade@mercury:~$ curl --connect-timeout 1 http://10.255.255.1/
curl: (28) Connection timed out after 1001 milliseconds
renegade@mercury:~$ netcat -l 3456 &> /dev/null & curl --max-time 1 http://localhost:3456/
curl: (28) Operation timed out after 1000 milliseconds with 0 bytes received
from http-client.
@Renegade334 yes that makes sense. We could even go for 3 time outs:
- Connect timeout, how long we wait for the connection to be created, done in
socket-client
- Response timeout, how long a server can take before responding
- Response body timeout, how long it can take before the entire response body is downloaded
from http-client.
FWIW: This is likely related to #36. Possible implementation approach could be to just close()
the request once the timeout timer fires.
from http-client.
I'm closing this as it is already supported by the new HTTP client that has been merged into react/http
via reactphp/http#368 You should upgrade as per #152 π
from http-client.
Related Issues (20)
- Time Out Question HOT 1
- question regarding writing HOT 2
- Hanging connector HOT 1
- Unable to validate "1 " as chunk length header HOT 3
- strtolower() expects parameter 1 to be string, array given HOT 1
- Delay Request Connection HOT 6
- Error on "close" event HOT 8
- How to get the full response body? HOT 1
- [bug]Concurrent with more than 1000 requests. HOT 4
- client pool HOT 1
- Memory leak in SecureConnector HOT 4
- Integrate Server Sent event api (EventSource) or streaming HTTP api HOT 1
- Support detecting response body boundaries HOT 1
- Can this library be used in php-fpm mode? HOT 2
- Trying to POST multipart/form-data HOT 2
- Support for certificate authentication when using HttpClientAdapter HOT 1
- Stop streaming half-way. HOT 1
- Support HTTP upgrades (WebSocket etc.) HOT 1
- is $loop->run(); blocking? HOT 4
- Heads up! Development focus on react/http
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-client.