alloclim

package
v0.0.0-...-6e19431 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

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()

If the reservation is granted, release it, otherwise cancel the reservation.

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