Futures are basically the same as promises. Java and C# also call them Futures. The futures library also provides streams, which are similar to Node streams but more strongly typed. Streams are to futures as arrays are to values. Streams can even be viewed as a
into_future, where the resolved value is the next item in the stream along with the rest of the stream. This seems like a really neat feature.
Tokio-core depends on / is built on top of Futures and Mio. This library provides the I/O primitives and event loop for async I/O in Rust. It’s the connection between futures and mio. For example, connecting a TCP stream returns a
Future resolving to a TCP stream, and a TCP listener implements a stream of TCP streams (accepted connections).
Hacker Noon is how hackers start their afternoons. We’re a part of the @AMIfamily. We are now accepting submissions and happy to discuss advertising &sponsorship opportunities.
To learn more, read our about page, like/message us on Facebook, or simply, tweet/DM @HackerNoon.
If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!
Create your free account to unlock your custom reading experience.