semaphore

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 2 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 struct {
	// contains filtered or unexported fields
}

func New

func New(maxConcurrentNum int64) *Semaphore

New creates a new Semaphore instance

func (*Semaphore) Acquire

func (s *Semaphore) Acquire() error

Acquire acquires a semaphore, blocking until resources are available

func (*Semaphore) Release

func (s *Semaphore) Release()

Release releases a semaphore

func (*Semaphore) Wait

func (s *Semaphore) Wait() error

Wait acquires the MaxConcurrentNum semaphore, blocking until all resources are available

Jump to

Keyboard shortcuts

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