News for hackers. Stuff that matters.
Re:Async-await on stable Rust by mamcx on Thursday November 07, 2019 @11:51AM (#21474841)
> If you don't want to deal with async functions, then you can use threads!

Truly? If some very popular lib become async (like actix, request, that I use), I can TRULY ignore it and not split my world in async/sync?

Re:Async-await on stable Rust by pcwalton on Thursday November 07, 2019 @12:05PM (#21474968)
You can easily convert async to sync by just blocking on the result. The other way (sync to async) is more difficult and requires proxying out to a thread pool, but it's also doable.
Re:Async-await on stable Rust by BatmanAoD on Monday November 11, 2019 @02:00PM (#21507718)
An `async` function _can_ call blocking functions, of course, it just blocks the entire thread of execution which could otherwise continue making progress by polling another future.
Re:Async-await on stable Rust by nemothekid on Thursday November 07, 2019 @12:25PM (#21475148)
Both actix and reqwest are already async, the fact that you haven't noticed yet just shows that you are already ignoring it.
Re:Async-await on stable Rust by mamcx on Thursday November 07, 2019 @12:56PM (#21475491)
But the signatures are not. If them mark the types/functions async, what happened?

I must rewrite all the calls?

Re:Async-await on stable Rust by pas on Thursday November 07, 2019 @01:19PM (#21475747)
Async is just a syntactic sugar for Future<...>, you can poll() it manually.

You can take the event loop, run it on one thread and do whatever you wish on other threads.

Fearless concurrency, after all.

Re:Async-await on stable Rust by bluejekyll on Thursday November 07, 2019 @01:53PM (#21476107)
you can just `.await` on any Future returned directly by APIs, if it's not marked as an async fn.