Skip to content

Timeouts for synchronization primitives #3911

Answered by carllerche
johannescpk asked this question in Ideas
Discussion options

You must be logged in to vote

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:

time::timeout(duration, my_async_mutex.lock()).await

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@johannescpk
Comment options

@hawkw
Comment options

@johannescpk
Comment options

@Darksonn
Comment options

Answer selected by johannescpk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants