3 ms·
I haven't yet used channels anywhere in Rust, but my frustration with async mutexes is growing stronger. Do you care to show any examples?
by selfmodruntime 1y ago
I haven't yet used channels anywhere in Rust, but my frustration with async mutexes is growing stronger. Do you care to show any examples?
- tcfhgj 1y agoasync mutexes? > Contrary to popular belief, it is ok and often preferred to use the ordinary Mutex from the standard library in asynchronous code. > The feature that the async mutex offers over the blocking mutex is the ability to keep it locked across an .await point. https://docs.rs/tokio/latest/tokio/sync/struct.Mutex.html https://docs.rs/tokio/latest/tokio/sync/struct.Mutex.html