nathansizemore
Joined 10 years ago
Joined 10 years ago
I wanted to use Rust and learn epoll through working with it directly.
> I was hoping Rust wouldn't head down this road.
To my knowledge, Rust does not have a std async story. I hope it will, and I believe libs like mio will help flush out platform agnostic ideas and a tested API.
> To preempt: a systems language shouldn't dictate these high-level matters
All of your cited example languages are _not_ systems language? Node.js isn't even a language? It could be listed above with the rest of your async I/O options across several languages.
So, the framework itself does not implement any of that, it is on the consumer. It just calls the proper methods on the trait object provided.
https://nathansizemore.github.io/hydrogen/hydrogen/trait.Str...
In the README example, I'm using it combined with another streaming crate I made, which does provide all of the internal buffering and state management for non-blocking I/O.
Well, hyper is a lib for dealing with the HTTP protocol. If being cross platform did not matter, hyper could be build atop of this.
I did not go the route of mio because I wanted to learn the entire process of working with epoll by doing it myself. I've learned a lot, and would not have that knowledge if I just built atop of mio. Mio must also provide a unified abstraction across platforms, where I was free to experiment and change at will during the building process.
mio is a crate that offers more platform agnostic async I/O.