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 upStabilize HTTP library #17
Comments
SergioBenitez
added this to the 1.0 milestone
Oct 4, 2016
This comment has been minimized.
This comment has been minimized.
steveklabnik
commented
Dec 23, 2016
|
I'd be very interested in hearing about your issues here. Also, have you used the |
This comment has been minimized.
This comment has been minimized.
aturon
commented
Dec 23, 2016
|
@SergioBenitez The Tokio team is working toward a 0.1 release of the Tokio stack, after which HTTP is likely to be more of a focus. We should try to work together in exploring the space. Let's be in touch! |
This comment has been minimized.
This comment has been minimized.
yazaddaruvala
commented
Dec 24, 2016
|
@SergioBenitez if the plan is to move to an async back end, why does the current API not use Futures? Or is the plan to change the API to a Futures based interface before 1.0? Or do you plan to keep the sync API interface but have an async backend? |
This comment has been minimized.
This comment has been minimized.
blaenk
commented
Jan 11, 2017
•
|
I'm also curious about what @yazaddaruvala said. It would seem to me that Futures would be returned as a a way of future-proofing for async. Then again, maybe it's possible to accommodate handlers that return Futures and those that don't? Perhaps even using codegen/procedural macros. I ask in light of tokio reaching 1.0, hopefully increasing the pace at which async infrastructure is developed. |
This comment has been minimized.
This comment has been minimized.
|
Tokio has reached version 0.1, not 1.0! @yazaddaruvala To directly answer your question, there's no point to having the Rocket API know about any kind of asynchronous I/O as Rocket doesn't perform async. I/O. Having some notions of async. I/O that don't, in reality, perform the I/O asynchronously would be rather confusing. I don't have a design I'm willing to commit to at this point. The Rust asynchronous I/O space is in heavy flux. The Tokio 0.1 release today is a milestone in reaching stability, but there's still a long road ahead. Rocket will be fully asynchronous in the future, but the approach must be made with care. Usability is of utmost importance, and performing and handling async. I/O with Rocket cannot be an exception. |
This comment has been minimized.
This comment has been minimized.
blaenk
commented
Jan 11, 2017
|
You're right! Clearly misread on my part. |
This comment has been minimized.
This comment has been minimized.
yazaddaruvala
commented
Jan 12, 2017
|
@SergioBenitez I can appreciate that it might be too early to make implementation decisions. However, its not clear from your comment or the rest of this thread, and I'm curious about your vision. Does sync IO, fit with your current vision of what Rocket will be? Asked a different way: Is there a possibility that, a future 1.0 release of Rocket could use synchronous IO or can you guarantee that the 1.0 release of Rocket (whenever that comes out) will be based on some implementation of async IO? |
This comment has been minimized.
This comment has been minimized.
|
As I said in my previous comment: Rocket will be fully asynchronous in the future. This issue will not be resolved until the HTTP server backend is stabilized, and this issue is currently set to be resolved before 1.0. I consider asynchronous I/O to be a requirement for stability. |
This comment has been minimized.
This comment has been minimized.
flosse
commented
Jan 18, 2017
|
BTW: Hyper just merged the tokio branch: hyperium/hyper@2d2d557 |
This comment has been minimized.
This comment has been minimized.
thedrow
commented
Jan 23, 2017
|
Do you guys think that HTTP 2 support is a separate issue? I don't think hyper supports it but the https://github.com/mlalic/solicit crate provides some degree of support. |
This comment has been minimized.
This comment has been minimized.
mgattozzi
commented
Jan 23, 2017
|
@thedrow Hyper plans on doing HTTP2 support before hitting 1.0 |
This comment has been minimized.
This comment has been minimized.
JonasZ95
commented
Feb 22, 2017
|
@SergioBenitez Do I get this right, you don't have any plans to add futures as return values for handlers? If so I think that icould be troublesome, because you may query a database in a handler which results mostly in IO. Returning a future would allow nice chaining. |
This comment has been minimized.
This comment has been minimized.
|
@JonasZ95 I certainly didn't say that. |
SergioBenitez
referenced this issue
Mar 26, 2017
Closed
slow image serving with (changed) static_files example #243
SergioBenitez
referenced this issue
Apr 14, 2017
Closed
Launching multiple rockets on the same port does not report an error. #209
cgm616
referenced this issue
May 3, 2017
Open
Make server wait a random amount of time when username is bad to mimic password being bad #11
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
flosse
commented
Jun 13, 2017
|
FYI: hyper |
SergioBenitez
referenced this issue
Jul 2, 2017
Closed
The restriction on the length of the content with a high RPS #286
This comment has been minimized.
This comment has been minimized.
beatgammit
commented
Jul 25, 2017
|
Is this currently a development priority? If so, is someone working on it? I don't see a branch for this, so my guess is no. I may be interested in helping port to hyper 0.11 (async), but I'm a bit unclear with the Rocket codebase (just started using it for a project) so I don't feel like I have a good intuition as to what a good API would look like. |
This comment has been minimized.
This comment has been minimized.
|
@beatgammit Maybe look at Right now Rocket handlers can return anything implementing #[get("/")]
// is this the proper syntax?
fn hello() -> impl Future<String, io::Error> {
future::ok(String::from("hello"))
} |
This comment has been minimized.
This comment has been minimized.
lilianmoraru
commented
Sep 4, 2017
|
Futures Await now work on nightly: https://github.com/alexcrichton/futures-await |
SergioBenitez
referenced this issue
Sep 7, 2017
Closed
Possibly use rayon for the worker threads #417
This comment has been minimized.
This comment has been minimized.
harryfei
commented
Feb 12, 2018
|
Repost the question #559 here. Does anyone have experience with actix-web. It seems that it support HTTP, HTTP2, async concurrency and websocket which are needed to implement a morden web server. |
This comment has been minimized.
This comment has been minimized.
mersinvald
commented
Feb 14, 2018
•
|
Rocket looks so nice, but its synchronous nature is still a showstopper for services requiring to access external APIs while handling requests. Any progress on bringing async into rocket like an optional feature for writing handlers? How complex would it be to implement an initial support for futures-backed Rocket? |
This comment has been minimized.
This comment has been minimized.
alexreg
commented
Jun 7, 2018
|
@krircc Using lots of features doesn't mean it's well-engineered. But that's your opinion. I wouldn't trust it with corner cases, personally. I know hyper handles those well. But then maybe I need to look at it closer... |
This comment has been minimized.
This comment has been minimized.
alexreg
commented
Jun 7, 2018
|
@krircc Up-voting your own comments? And serial down-voting rather than replying? Wow, looks like someone is passive-agressive. |
This comment has been minimized.
This comment has been minimized.
krircc
commented
Jun 7, 2018
•
|
@alexreg sorry I am no interesting about you words, I say the trues . you should know more actix/actix-web first, even if Rocket not use it. |
This comment has been minimized.
This comment has been minimized.
xvny
commented
Jun 7, 2018
•
|
The new benchmarks looks actix-web exicting https://www.techempower.com/benchmarks/#section=data-r16&hw=cl&test=json |
This comment has been minimized.
This comment has been minimized.
hayd
commented
Jun 7, 2018
|
Please can we stop this back-and-forth? It is not productive. |
This comment has been minimized.
This comment has been minimized.
alexreg
commented
Jun 7, 2018
•
|
This little dispute is over now, as far as I'm concerned. |
This comment has been minimized.
This comment has been minimized.
JMurph2015
commented
Jun 24, 2018
|
Just as a note: actix-web is going to need a lot of TLC and a step change in its approach to the use of unsafe code before it can be called production ready. I'm not saying it's a "bad library" or anything like that, but right now, it has pieces of code that are completely UB and could really bite. https://www.reddit.com/r/rust/comments/8s7gei/unsafe_rust_in_actixweb_other_libraries/ |
This comment has been minimized.
This comment has been minimized.
oblitum
commented
Jun 24, 2018
|
@JMurph2015 it's a work in progress https://twitter.com/mitsuhiko/status/1010093896230146048. That it's also at the hands of the author of Flask turns it promising. |
This comment has been minimized.
This comment has been minimized.
apiraino
commented
Jun 24, 2018
|
@JMurph2015 just trying to disentagle the acronyms TLC (Testing Life Cycle) and UB (Undefined Behaviour); am I correct? TY - thank you ;-) |
This comment has been minimized.
This comment has been minimized.
JMurph2015
commented
Jun 25, 2018
|
@apiraino Sorry for the acronym soup *not using the 'in production" trope because these days if it doesn't come off of stone tablets written in lightning, someone will complain about it not being "production ready" |
This comment has been minimized.
This comment has been minimized.
oblitum
commented
Jun 25, 2018
|
This comment just sounds as out of place here, maybe ask them about the issue? AFAIK there's not even serious conversation about adoption of that or any other lib in Rocket, so will this thread be about opinions on every web framework? Regarding actix, from what I can see they're serious on removing unsafe, and it was born just like yesterday, why the rush?! |
This comment has been minimized.
This comment has been minimized.
JMurph2015
commented
Jun 25, 2018
|
@oblitum At some point Rocket may want to use another HTTP library so that it can support async operation asap. This thread was discussing options in that direction, and when I read it, I noticed that the safety angle of Actix had yet to be considered, and since it was still "in the running" so to speak, it was a relavent comment. There isn't really a rush within Rocket to do this, but at the same time the ecosystem will jump on async operation as soon as support for it is ironed out, which is fast approaching. |
This comment has been minimized.
This comment has been minimized.
JMurph2015
commented
Jun 25, 2018
|
Also what's with the thumbs down reactions in this thread? We're all here to make constructive conversation about the pros and cons of various approaches to solve a problem, no need to be pushy or rude? |
This comment has been minimized.
This comment has been minimized.
oblitum
commented
Jun 25, 2018
|
Just seems to be getting increasingly toxic. |
This comment has been minimized.
This comment has been minimized.
hayd
commented
Jun 25, 2018
|
See my above comment:
We're not gaining anything by rehashing this. |
SergioBenitez
referenced this issue
Jul 19, 2018
Closed
Question about worker & concurrent serve incoming http request #707
This comment has been minimized.
This comment has been minimized.
dvic
commented
Aug 22, 2018
|
@SergioBenitez I was curious, have you figured out in what direction you want to move with the http layer? |
This comment has been minimized.
This comment has been minimized.
|
@dvic In 0.5, we'll explore migrating to the latest version of |
This comment has been minimized.
This comment has been minimized.
geromueller
commented
Oct 13, 2018
•
|
Hi! I'm currently investigating all rust frameworks as an api service. Unfortunately all are in a bad state, as all want to jump on the async train. @SergioBenitez what about database access? What about easyness of coding? Async code is harder to implement and has nearly no speed improvement. A web framework is not a web server. Will rocket for sure switch to async in the near future? |
This comment has been minimized.
This comment has been minimized.
mgattozzi
commented
Oct 15, 2018
|
@geromueller I don't know how much you know about the upcoming As for database access again, shouldn't be a problem for the reasons I mentioned before, same goes for ease of coding. Hyper is has moved to async and newer versions will use async/await syntax. Assuming Rocket upgrades it's hyper dep it'll have to move over to it.
Gonna need a use case or a citation for that one. Not saying it's wrong, but it sounds like that's the case for a specific use case |
This comment has been minimized.
This comment has been minimized.
Maybe see http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/. Anyway, most web apps don't need async, and for database access a thread pool is usually more than enough. |
This comment has been minimized.
This comment has been minimized.
geromueller
commented
Oct 15, 2018
•
|
Thanks for the detailed reply @mgattozzi ! I had the results from the link @lnicola posted in mind as well as the discussion in diesel-rs/diesel#399 and the state of many async drivers in Java. I'd really like to write my service in Rust, but currently all franeworks are waiting for async stuff to happen and ready up for a complete rewrite. Tried actix-web and pushing database stuff into different threads and managing messages is far from Edit: |
This comment has been minimized.
This comment has been minimized.
I have a tiny adapter that transforms any sync code into a |
This comment has been minimized.
This comment has been minimized.
geromueller
commented
Oct 15, 2018
|
This comment has been minimized.
This comment has been minimized.
Maybe try making an example app and publishing it somewhere? I guarantee it's possible. If you start something and run into issues, you can ping me.
Right. As I said, I'm not a web dev, so I've no idea why a web framework should care about database access.
Sure, with a thread pool you get that. With |
This comment has been minimized.
This comment has been minimized.
steveklabnik
commented
Oct 15, 2018
|
Litigating the useful-ness of asynchronous programming is extremely off-topic for this issue, IMHO. Could we maybe not do this here? |
This comment has been minimized.
This comment has been minimized.
geromueller
commented
Oct 15, 2018
•
|
To summarize my concern: You can not just switch from sync to async without big changes in the user code. And for a new project API stability is an issue. |
SergioBenitez commentedOct 1, 2016
•
edited
At present, Rocket reexports Hyper types under
http:hyper. Hyper causes a lot of issues, particularly when trying to optimize performance. A decision needs to be made on whether to stabilize these Hyper types, move away from Hyper (likely), or do something else all-together.