You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// WithMessage adds the provided message to the provided context
79
79
// to add additional message that need to be used to context.
@@ -167,6 +167,7 @@ You can find list of returning error types for all existing throttlers in thrott
167
167
| generator |`func NewThrottlerGenerator(gen Generator, capacity uint64, eviction float64) Throttler`| Creates new throttler instance that throttles if found key matching throttler throttles.<br> If no key matching throttler has been found generator used insted to provide new throttler that will be added to existing throttlers map.<br> Generated throttlers are kept in bounded map with capacity *c* defined by the specified capacity and eviction rate *e* defined by specified eviction value is normalized to [0.0, 1.0], where eviction rate affects number of throttlers that will be removed from the map after bounds overflow.<br> Use `WithKey` to specify key for throttler matching and generation.<br> - could return `ErrorInternal`;<br> - could return any underlying throttler error; |
168
168
| semaphore |`func NewThrottlerSemaphore(weight int64) Throttler`| Creates new throttler instance that throttles call if underlying semaphore throttles.<br>Use `WithWeight` to override context call weight, 1 by default.<br> - could return `ErrorThreshold`; |
169
169
| cellrate |`func NewThrottlerCellRate(threshold uint64, interval time.Duration, monotone bool) Throttler`| Creates new throttler instance that uses generic cell rate algorithm to throttles call within provided interval and threshold.<br>If provided monotone flag is set class to release will have no effect on throttler.<br>Use `WithWeight` to override context call qunatity, 1 by default.<br> - could return `ErrorThreshold`; |
170
+
| bucket |`func NewThrottlerBucket(threshold uint64, interval time.Duration, monotone bool) Throttler`| Creates new throttler instance that leaky bucket algorithm to throttles call within provided interval and threshold.<br>If provided monotone flag is set class to release will have no effect on throttler.<br>Use `WithWeight` to override context call qunatity, 1 by default.<br> - could return `ErrorThreshold`; |
0 commit comments