func NewThrottle(l int) *Throttle {
	return &Throttle{
		limit: sync2.NewAtomicInt32(int32(l)),
		rate:  rate.New(l, time.Second),
	}
}
NewThrottle creates the new throttle.
package xbase
import (
	"sync"
	"time"
	"xbase/sync2"
	"github.com/beefsack/go-rate"
)
type Throttle struct {
	limit sync2.AtomicInt32
	rate  *rate.RateLimiter
	mu    sync.Mutex
}