-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine the future of tokio-proto #118
Comments
yes :) I already asked for some clarification: tokio-rs/tokio-proto#202
I won't be able to spend much time but I could give some feedback as a library developer. |
Although I tried very hard to use |
@djc Thanks for the insights. This leads to my thoughts to totally deprecate |
[It's been suggested on Gitter that I open an issue similar to this one; I saw the one mentioned by @flosse and intended to respond there, but this is an even better place.] I concur with @flosse that an heir to
That may sound quite critical, but I'll reiterate that my overall experience with the crate was quite good. I especially liked the ease of slotting in a completely separate type of transport (Unix domain sockets) in a client when the need arose, as well as the fairly modest set of changes required for implementing things like StartTLS, after some type wrestling. I think that the division of protocols into pipelined and multiplexed is sound and essential, but that streaming variants are adding more complexity than necessary, and that the crate would be majorly simplified by ditching them. Furthermore, client and server roles could be separated into their own crates, leaving the users a much clearer choice and a lower cognitive burden. I intend to analyze |
@inejge Great to hear. I do think that a simplified tokio-proto has value. The primary issue is that this is pretty close to a rewrite and my time is currently pretty limited. If you have availability to take on the work, I can provide guidance. |
It's interesting: there are 46 crates that depend on |
I've used tokio-proto because it's the fastest way to get off the ground, and I trusted @carllerche to write a better and more performant server implementation than I would with the time I have. If it didn't exist, I'd probably just settle for a simpler, less performant server implementation. |
I'm in the process of starting a project that is using tokio to implement a simple line based protocol over serial lines, and using I would be happy to help with that effort, though I can't commit a ton of time to it. |
Ok, I will try to put together a more organized group to attempt to take over -proto. |
TL;DR: take tokio-proto split it into a non-tokio specific service crate and a crate for impl protocols and focus this on tools helping you implement on aspects each instead of providing a frameworkish interface like tokio-proto currently does. My experience with tokio-proto was:
*this is my subjective experience when playing around with tokio and e.g. implementing smtp I cam to the believe that instead of having tokio-proto it might be better to have
|
@dathinab I like your thoughts :) It would be really helpful for me to see some examples to learn from. Maybe we could just collect experiences from library authors with some descriptions how they solved their problems or how they migrated form |
you can take a look at new-tokio-smtp Through it is might not be the best example here. Some aspects of it:
Tools I would like to have had:
|
It looks like the new tokio-codec might be the base for a tokio-proto replacement? |
I did start my project with tokio-proto, but since I swapped it out for new tokio without proto, life got more joyful again in Samotop. |
I'm in the process of moving tarpc off of tokio-proto. In lieu of tokio-proto, I wrote a simplified, non-streaming, request-response framework. It all makes use of unstable nightly futures and async/await, so it's not really a stable replacement for tokio-proto. But if it sounds like something that interests any of you, take a look here (I probably won't merge it for a while, as it will break all current tarpc users): https://github.com/google/tarpc/pull/199/files |
The future of tokio-proto is |
The tokio-proto crate was part of the initial release of Tokio. At that point, Tokio was focused on providing a higher level request / response based API and the I/O reactor was an implementation detail.
Today, focus has shifted and Tokio is now primarily a non-blocking I/O library and the request / response aspect is being shifted to Tower (which has not yet been released).
One problem that tokio-proto faces was that it was trying to be a one size fits all solution to binding
Service
to a socket. It tries to provide many capabilities at the cost of significant complexity. Even with all these features, libraries like h2 have opted to not use it.That said, the idea of
tokio-proto
still has value in providing an easy way to bind a socket to a service. Ideally, the next iteration oftokio-proto
would be significantly simplified to assist with getting something working fast with the assumption that, if advanced features are required, one would not use the library.Now, resources to maintain development of tokio-proto are currently limited. So, I would ask the community there is any interest in a simplified
tokio-proto
and if there are any volunteers willing to take on some of the burden in developing & maintaining the crate.The text was updated successfully, but these errors were encountered: