-
Notifications
You must be signed in to change notification settings - Fork 0
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
Migrate Away From Internal Executor #2
Comments
Hey 👋 |
Hey there, thanks for the note. 😃 I'll let you know if I have any trouble. I just took a look at the source code for Agnostik which is very simple and short, which is nice. Interesting timing, though, because I just found smol this morning and it looks like it might be a good fit and compatible Tokio and async-std. I might end up just using I'll look into them both a bit more when I get down to actually working on it and any progress/decisions I make will be posted here. |
I'm leaning towards https://github.com/stjepang/smol/blob/master/examples/other-runtimes.rs fn main() -> Result<()> {
smol::run(async {
// Sleep using async-std.
let start = Instant::now();
println!("Sleeping using async-std...");
async_std::task::sleep(Duration::from_secs(1)).await;
println!("Woke up after {:?}", start.elapsed());
// Sleep using tokio (the `tokio02` feature must be enabled).
let start = Instant::now();
println!("Sleeping using tokio...");
tokio::time::delay_for(Duration::from_secs(1)).await;
println!("Woke up after {:?}", start.elapsed());
// Make a GET request using surf.
let body = surf::get("https://www.rust-lang.org")
.recv_string()
.await
.map_err(Error::msg)?;
println!("Body from surf: {:?}", body);
// Make a GET request using reqwest (the `tokio02` feature must be enabled).
let resp = reqwest::get("https://www.rust-lang.org").await?;
let body = resp.text().await?;
println!("Body from reqwest: {:?}", body);
Ok(())
})
} |
I will add smol support to agnostik very soon. In the Next Agnostik you will also be able to implement your own executors so it’s super simple to add a new executor backend. |
We want to use Agnostik for the executor instead of maintaining our own.
The text was updated successfully, but these errors were encountered: