Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SemaphoreGroup ¶
type SemaphoreGroup struct {
// contains filtered or unexported fields
}
SemaphoreGroup is a custom type that combines sync.WaitGroup and a semaphore.
func NewSemaphoreGroup ¶
func NewSemaphoreGroup(limit int) *SemaphoreGroup
NewSemaphoreGroup creates a new SemaphoreGroup with the specified semaphore limit.
func (*SemaphoreGroup) Add ¶
func (sg *SemaphoreGroup) Add(ctx context.Context) error
Add acquire a slot
func (*SemaphoreGroup) Done ¶
func (sg *SemaphoreGroup) Done()
Done releases a slot. Must be called after a successful Add.
Click to show internal directories.
Click to hide internal directories.