pacer: add ZeroDelayCalculator

This commit is contained in:
Ovidiu Victor Tatar 2022-07-07 19:58:21 +02:00 committed by Nick Craig-Wood
parent 53400d7edc
commit 502226bfc8

View File

@ -104,6 +104,15 @@ func (c *Default) Calculate(state State) time.Duration {
return sleepTime
}
// ZeroDelayCalculator is a Calculator that never delays.
type ZeroDelayCalculator struct {
}
// Calculate takes the current Pacer state and return the wait time until the next try.
func (c *ZeroDelayCalculator) Calculate(state State) time.Duration {
return 0
}
// AmazonCloudDrive is a specialized pacer for Amazon Drive
//
// It implements a truncated exponential backoff strategy with randomization.