If `wait` can be a function, then you can easily implement things like exponential backoff. See https://github.com/gabegorelick/yarnl/#custom-backoff-strategies for example.