Module retry

Source

Statics§

DEBUG

Functions§

retry
Rerun f until it returns Ok, only sleeps after 100 attempts, panics after 200 attempts. Mostly useful for atomic compare_exchange. I.e. do not use if f expects a value from another thread; just do retries that should succeed except for bad luck when another thread is making a change at the same time.
retry_n
Rerun f until it returns Ok or max_tries has run out. Sleeps a constant time between tries.