semaphore

package
v0.0.0-...-72af66c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0, BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package semaphore implements a weighted semaphore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Weighted

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

func NewWeighted

func NewWeighted(n int64) *Weighted

func (*Weighted) Acquire

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

func (*Weighted) Release

func (s *Weighted) Release(n int64)

func (*Weighted) SetLimit

func (s *Weighted) SetLimit(n int64)

func (*Weighted) TryAcquire

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

Jump to

Keyboard shortcuts

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