calculateRetryDuration
Calculates the duration after which the request can be retried. The retry duration depends on the rate limiting algorithm, the current state of the semaphore and the number of permits requested. For example, a token bucket algorithm may return a retry duration based on the time left until the requested permits are available (which may not happen in the next replenishment period).
Parameters
permits
The number of permits requested.