func (rl *MultiRateLimiterImpl) AllowN(now time.Time, numToken int) bool {
	length := len(rl.rateLimiters)
	reservations := make([]Reservation, 0, length)
	for _, rateLimiter := range rl.rateLimiters {
		reservation := rateLimiter.ReserveN(now, numToken)
		if !reservation.OK() || reservation.DelayFrom(now) > 0 {
			if reservation.OK() {
				reservation.CancelAt(now)
			}
			for _, reservation := range reservations {
				reservation.CancelAt(now)
			}
			return false
		}
		reservations = append(reservations, reservation)
	}
	return true
}
AllowN immediately returns with true or false indicating if n rate limit
token is available or not
package quotas
import (
	"context"
	"fmt"
	"time"
	"golang.org/x/time/rate"
)
const (
	InfDuration = rate.InfDuration
)
type (
	MultiRateLimiterImpl struct {
		rateLimiters []RateLimiter
	}
)
var _ RateLimiter = (*MultiRateLimiterImpl)(nil)
func NewMultiRateLimiter(
	rateLimiters []RateLimiter,
) *MultiRateLimiterImpl {
	if len(rateLimiters) == 0 {
		panic("expect at least one rate limiter")
	}
	return &MultiRateLimiterImpl{
		rateLimiters: rateLimiters,
	}
}
func (rl *MultiRateLimiterImpl) Allow() bool {
	return rl.AllowN(time.Now(), 1)
}