4 ms·
It doesn't take a week to learn the async basics. add async keyword to functions add .await when calling them use tokio in your main function (easy to look up)
by dana321 5mo ago
It doesn't take a week to learn the async basics.
add async keyword to functions
add .await when calling them
use tokio in your main function (easy to look up)
use the async recursion crate if you need to use recursion but don't want to box everything
There are some bonuses like calling functions in parallel, but there you go.
- usrnm 5mo agoAnd then you want to do something trivial like an async callback
- dragochat 5mo ago> trivial like an async callback can't for the love of dog parse the meaning of this - what do you mean? a callback that is async passed to a sync api? you refer to the complexity of sync<->async bridging? ...or?
- usrnm 5mo agoJust pass it around, store it and then call it. What type does it have? AsyncFn is still an experimental API.