Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Just because async is in the language, don't feel like you need to use it everywhere.

Except that you will have to because no alternative library exist



It's easy to convert an async function into a blocking one. For example, you could use https://docs.rs/async-std/1.9.0/async_std/task/fn.block_on.h...

So just use the async functions from the library synchronously if you want.


But you can't really do vice-versa.


Well, you can use https://docs.rs/async-std/1.9.0/async_std/task/fn.spawn_bloc...

But this is partly the reason why libraries might be more inclined to support async rather than blocking calls.


You know you can just write your own code and not just glue libraries together? In general I find Rust less dependant on libraries because pretty much all the basic building blocks are exposed and available. You can pretty much just start doing syscalls directly if needed


What libraries are you trying to use for what tasks that you can only find async libraries?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: