Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore allows you to control the number of in-flight requests of a given service.
func (*Semaphore) Acquire ¶
func (s *Semaphore) Acquire()
Acquire blocks until a worker becomes available.
func (*Semaphore) AcquireContext ¶
AcquireContext attempts to acquire a resource. AcquireContext returns false if we were unable to acquire a resource before the Context timed out or was canceled.
func (*Semaphore) Drain ¶
func (s *Semaphore) Drain()
Drain releases all resources that have been acquired by this semaphore.
Click to show internal directories.
Click to hide internal directories.