Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/boz/go-throttle
/ functions
Functions
17 in github.com/boz/go-throttle
⨍
Functions
17
◇
Types & classes
3
↓ 10 callers
Method
Trigger
Trigger() requests execution of the throttled resource.
throttle.go:40
↓ 8 callers
Method
Stop
Stop() stops the throttler.
throttle.go:43
↓ 7 callers
Method
Next
Next() returns true at most once per `period`. If false is returned the throttler has been stoped.
throttle.go:51
↓ 2 callers
Function
newThrottler
(period time.Duration, trailing bool)
throttle.go:81
Function
ExampleNewThrottle_trailing
()
example_test.go:36
Function
ExampleNewThrottle_untrailing
()
example_test.go:14
Function
ExampleThrottleFunc
()
example_test.go:61
Function
NewThrottle
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
Method
Next
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
Method
Stop
Stop the throttle
throttle.go:126
Function
Test_MultiPingInMultiplePeriod
(t *testing.T)
throttle_test.go:64
Function
Test_MultiPingInOnePeriod
(t *testing.T)
throttle_test.go:35
Function
Test_NoPings
(t *testing.T)
throttle_test.go:11
Function
Test_ThrottleFunc
(t *testing.T)
throttle_test.go:132
Function
Test_TrailingMultiPingInOnePeriod
(t *testing.T)
throttle_test.go:94
Function
ThrottleFunc
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
Method
Trigger
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