mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
revert
parent
3788f39d5e
commit
78be9b4e94
@ -9,7 +9,7 @@ For higher rates, prefer a token bucket rate limiter such as [golang.org/x/time/
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
rate := time.Second / 10
|
rate := time.Second / 10
|
||||||
throttle := time.Ticker(rate)
|
throttle := time.Tick(rate)
|
||||||
for req := range requests {
|
for req := range requests {
|
||||||
<-throttle // rate limit our Service.Method RPCs
|
<-throttle // rate limit our Service.Method RPCs
|
||||||
go client.Call("Service.Method", req, ...)
|
go client.Call("Service.Method", req, ...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user