sem

package
v1.4.105 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Semaphore

type Semaphore interface {
	// Acquire blocks until a slot is available in the semaphore.
	Acquire(context.Context) error

	// Release frees a slot in the semaphore.
	Release()
}

Semaphore is the interface that wraps basic Acquire and Release methods to control access to a limited resource pool.

func New

func New(n uint) Semaphore

New returns a Semaphore that allows up to n concurrent holders.

Jump to

Keyboard shortcuts

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