Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Throttler ¶
type Throttler struct {
// contains filtered or unexported fields
}
func NewThrottler ¶
Returns a new Throttler, which allows the retrival of up to perSecond tickets per second.
After a waiting for a ticket the ticket has either to be returned or used
func (*Throttler) RequestTicket ¶
func (throttler *Throttler) RequestTicket()
Blocks until a ticket is available. Afterwards either ReturnUnusedTicket() or UseTicket has to be called.
func (*Throttler) ReturnUnusedTicket ¶
func (throttler *Throttler) ReturnUnusedTicket()
Click to show internal directories.
Click to hide internal directories.