Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bxcodec committed Aug 11, 2024
1 parent a5a2fa6 commit 218c5ba
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions interfaces/delayfn.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package interfaces

import "fmt"

type DelayFn func(retries int64) (delay int64)

var (
// ExponentialBackoffDelayFn is a delay function that implements exponential backoff.
// It takes the number of retries as input and returns the delay in seconds.
ExponentialBackoffDelayFn DelayFn = func(retries int64) (delay int64) {
fmt.Println(">>>>> ExponentialBackoffDelayFn, retry: ", retries)
return 2 << (retries - 1)
}

// LinearDelayFn is a delay function that implements linear delay.
// It takes the number of retries as input and returns the delay in seconds.
LinearDelayFn DelayFn = func(retries int64) (delay int64) {
fmt.Println(">>>>> LinearDelayFn, retry: ", retries)
return retries
}

Expand Down

0 comments on commit 218c5ba

Please sign in to comment.