func()

in lambda/core/bandwidthlimiter/throttler.go [98:120]


func (th *Throttler) start() {
	if th.running {
		return
	}
	th.running = true
	th.metrics.StartReadingResponseMonoTimeMs = metering.Monotime()
	go func() {
		ticker := time.NewTicker(th.b.refillInterval)
		for {
			select {
			case <-ticker.C:
				th.b.produceTokens()
				select {
				case th.produced <- metering.Monotime():
				default:
				}
			case <-th.done:
				ticker.Stop()
				return
			}
		}
	}()
}