Comments (2)
Should it be the case that the http server just spews out new tasks for all incoming requests?
What if the Handler trait received an 'incoming’ function, with a default implementation to stay single tasked?
From: Jonathan Reem
Sent: Saturday, September 06, 2014 11:58 AM
To: seanmonstar/hyper
It appears to me that parallel connections block on handler.handle here https://github.com/seanmonstar/hyper/blob/master/src/server/mod.rs#L55.
This seems weird to me. I would much rather Handler: Clone, and for Handler to simply be copied for each request. That way, downstream users of this library have maximum control of what concurrency forms they want.
—
Reply to this email directly or view it on GitHub.
from hyper.
I think the best solution would be to expose a stream of Request/Response pairs as an Iterator, much like TcpStream, and then registered handlers would just receive this stream and can decide on whatever concurrency strategy they want.
I think this is the most flexible approach we could take, especially considering that it's unlikely most users will interact with hyper directly so providing flexibility to frameworks is key.
from hyper.
Related Issues (20)
- Hyper 0.14.27 deprecated/backports features don't produce any warnings, but can't upgrade to hyper 1.0 HOT 3
- UnexpectedEof Error on HTTP/2 Requests with Rustls HOT 16
- Error serving connection: hyper::Error(Http2, Error { kind: GoAway(b"", PROTOCOL_ERROR, Library) }) HOT 4
- Make send_file example streaming HOT 3
- hyper-util: add (tokio) Server struct and builder (inspired by Hyper 0.14) HOT 2
- [SSRF] Ability to prohibit connections to subnet ranges HOT 1
- Get some time informations about a request like curl/libcurl
- Harden against HTTP Desync attacks HOT 2
- ffi: different input and output types for tasks HOT 2
- Make examples usable (TokioIo) HOT 8
- CHANGELOG doesn't explain what happened to `hyper::Client` or `HttpConnector` HOT 8
- Documentation link in hyper::client::conn for "Higher-level Client API" should probably go to hyper-util now HOT 1
- First byte timeout HOT 1
- From v0.14 to v1 difficulties using Client HOT 1
- hyper-util Client examples are wrong HOT 1
- Upgraded does not impl AsyncRead/AsyncWrite in hyper 1.0 HOT 2
- Can not create hyper::Error HOT 3
- hyper-util missing `max_pending_accept_reset_streams` HOT 1
- There is no way to pass data to the new Server connection service in Hyper 1
- "make_service_fn" - gone. Where is it?
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 hyper.