dynsemaphore

package
v1.34.13 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRequestExceedsLimit = errors.New("dynsemaphore: request exceeds limit")

ErrRequestExceedsLimit is returned when a request exceeds the current limit.

Functions

This section is empty.

Types

type DynamicWeighted

type DynamicWeighted struct {
	// contains filtered or unexported fields
}

DynamicWeighted matches semaphore.Weighted API exactly, except the maximum size is provided dynamically.

func NewDynamicWeighted

func NewDynamicWeighted(limitFn func() int64) *DynamicWeighted

func NewDynamicWeightedWithParent

func NewDynamicWeightedWithParent(parent *DynamicWeighted, limitFn func() int64) *DynamicWeighted

func (*DynamicWeighted) Acquire

func (s *DynamicWeighted) Acquire(ctx context.Context, n int64) error

func (*DynamicWeighted) Release

func (s *DynamicWeighted) Release(n int64)

func (*DynamicWeighted) TryAcquire

func (s *DynamicWeighted) TryAcquire(n int64) bool

Jump to

Keyboard shortcuts

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