MCPcopy Create free account

hub / github.com/boz/go-throttle / functions

Functions17 in github.com/boz/go-throttle

↓ 10 callersMethodTrigger
Trigger() requests execution of the throttled resource.
throttle.go:40
↓ 8 callersMethodStop
Stop() stops the throttler.
throttle.go:43
↓ 7 callersMethodNext
Next() returns true at most once per `period`. If false is returned the throttler has been stoped.
throttle.go:51
↓ 2 callersFunctionnewThrottler
(period time.Duration, trailing bool)
throttle.go:81
FunctionExampleNewThrottle_trailing
()
example_test.go:36
FunctionExampleNewThrottle_untrailing
()
example_test.go:14
FunctionExampleThrottleFunc
()
example_test.go:61
FunctionNewThrottle
NewThrottle returns a new Throttle. If trailing is true then a multiple Trigger() calls in one period will cause a delayed Trigger() to be called in
throttle.go:56
MethodNext
Next() returns true at most once per period. While it returns true, the throttle is running. When it returns false the throttle has been stopped.
throttle.go:112
MethodStop
Stop the throttle
throttle.go:126
FunctionTest_MultiPingInMultiplePeriod
(t *testing.T)
throttle_test.go:64
FunctionTest_MultiPingInOnePeriod
(t *testing.T)
throttle_test.go:35
FunctionTest_NoPings
(t *testing.T)
throttle_test.go:11
FunctionTest_ThrottleFunc
(t *testing.T)
throttle_test.go:132
FunctionTest_TrailingMultiPingInOnePeriod
(t *testing.T)
throttle_test.go:94
FunctionThrottleFunc
ThottleFunc executes f at most once every period. Stop() must eventually be called on the return value to prevent a leaked go proc.
throttle.go:62
MethodTrigger
Trigger signals an attempt to execute the throttled code. If Trigger is called twice within the same period, Next() will be called once for that perio
throttle.go:92