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
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.
Click to show internal directories.
Click to hide internal directories.