-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
124 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ratelimiter | ||
|
||
import "time" | ||
|
||
type RateLimiter interface { | ||
// When gets an item and gets to decide how long that item should wait | ||
When(item interface{}) time.Duration | ||
// Forget indicates that an item is finished being retried. Doesn't matter whether it's for failing | ||
// or for success, we'll stop tracking it | ||
Forget(item interface{}) | ||
// NumRequeues returns back how many failures the item has had | ||
NumRequeues(item interface{}) int | ||
} |
Oops, something went wrong.