Timeouts for synchronization primitives #3911
-
Not sure if it's at all feasible/possible for tokio to add such features? But I'd find them useful for sure. If they're generally possible I'd also gladly take pointers on how the implementation could be approached. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
With async, you can add a timeout to any operation without an explicit API by using the so, you would do something like: time::timeout(duration, my_async_mutex.lock()).await |
Beta Was this translation helpful? Give feedback.
With async, you can add a timeout to any operation without an explicit API by using the
timeout
function.so, you would do something like: