Can someone explain to a non-rustacean what Tokio introduces that's not part of Rust? It looks like Rust provides the async/await semantics, so I'm guessing this is an event loop and dispatching system?
The Rust language provides the async/await syntax, which can turn imperative code into Future objects, but to run those Future objects, you must repeatedly call their poll method. Tokio is the piece of code that calls that method. It does so in a manner such that futures are only polled if able to continue work, and not e.g. waiting for a timer. Besides that it provides lots of utilities for working with async code.
Tokio 1.0 – async runtime for Rust
11–20 of 422 posts
Re: Tokio 1.0 – async runtime for Rust
#12Can someone explain to a non-rustacean what Tokio introduces that's not part of Rust? It looks like Rust provides the async/await semantics, so I'm guessing this is an event loop and dispatching system?
Replying to myself, I found this bit in the docs explaining how Tokio decorates the main: > An async fn is used as we want to enter an asynchronous context. However, asynchronous functions must be executed by a runtime. The runtime contains the asynchronous task scheduler, provides evented I/O, timers, etc.
(Some of those interoperation points are still being worked out, so it's not perfect yet.)
Re: Tokio 1.0 – async runtime for Rust
#13"we are committing to providing a stable foundation..."
I am curious: Who is "we"? I have no priors, I really have no idea.
Re: Tokio 1.0 – async runtime for Rust
#14Re: Tokio 1.0 – async runtime for Rust
#15The first two paragraphs have a lot of guarantees. About stability of version 1.0, length of support for version 1.0 and how long until version 2.0 (at least). "We "we are committing to providing a stable foundation..." I am curious: Who is "we"? I have no priors, I really have no idea.
Re: Tokio 1.0 – async runtime for Rust
#16Congrats! I've fallen off Rust due to pivoting at work plus trying other languages but I'm intrigued again by Tokio's announcement. I'll be trying out your tutorial soon!
Re: Tokio 1.0 – async runtime for Rust
#17The first two paragraphs have a lot of guarantees. About stability of version 1.0, length of support for version 1.0 and how long until version 2.0 (at least). "We "we are committing to providing a stable foundation..." I am curious: Who is "we"? I have no priors, I really have no idea.
Re: Tokio 1.0 – async runtime for Rust
#18Earlier quoted context omitted.
The Rust language provides the async/await syntax, which can turn imperative code into Future objects, but to run those Future objects, you must repeatedly call their poll method. Tokio is the piece of code that calls that method. It does so in a manner such that futures are only polled if able to continue work, and not e.g. waiting for a timer. Besides that it provides lots of utilities for working with async code.
Would it be fair to compare this to Apple's Grand Central Dispatch a.k.a. libdispatch?
Re: Tokio 1.0 – async runtime for Rust
#19Earlier quoted context omitted.
The Rust language provides the async/await syntax, which can turn imperative code into Future objects, but to run those Future objects, you must repeatedly call their poll method. Tokio is the piece of code that calls that method. It does so in a manner such that futures are only polled if able to continue work, and not e.g. waiting for a timer. Besides that it provides lots of utilities for working with async code.
Would it be fair to compare this to Apple's Grand Central Dispatch a.k.a. libdispatch?
Re: Tokio 1.0 – async runtime for Rust
#20What would be Tokios equivalent in .net/C# ?