semaphoregroup

package
v0.65.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL