package fed import "time" // SetLiveLimits shrinks the flood window, the byte ceiling and the first backoff; it returns the restore func. func SetLiveLimits(window time.Duration, bytesPerSec int, backoff time.Duration) func() { w, b, k := liveByteWindow, maxLiveBytes, liveBackoff0 liveByteWindow, maxLiveBytes, liveBackoff0 = window, bytesPerSec, backoff return func() { liveByteWindow, maxLiveBytes, liveBackoff0 = w, b, k } } // WaitStream blocks until the live stream goroutines have returned (after ctx is cancelled). func (h *Hub) WaitStream() { h.swg.Wait() }