alloclim

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MPL-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	// Maximum outstanding allocation space.
	Max int64
	// contains filtered or unexported fields
}

Manages reservations sharing a common allocation limit.

func (*Limiter) Reserve

func (me *Limiter) Reserve(n int64) *Reservation

func (*Limiter) Value

func (me *Limiter) Value() int64

type Reservation

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

func (*Reservation) Cancel

func (me *Reservation) Cancel() bool

Cancel the reservation, returns false if it was already granted. You must still release if that's the case. See Drop.

func (*Reservation) Drop

func (me *Reservation) Drop() (first bool)

If the reservation is granted, release it, otherwise cancel the reservation. Returns true if the reservation was released or cancelled for the first time.

func (*Reservation) Release

func (me *Reservation) Release()

Releases the alloc claim if the reservation has been granted. Does nothing if it was cancelled. Otherwise panics.

func (*Reservation) Wait

func (me *Reservation) Wait(ctx context.Context) error

Jump to

Keyboard shortcuts

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