bucket

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int64bucket

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

func (*Int64bucket) GetFreeResource

func (b *Int64bucket) GetFreeResource() int64

func (*Int64bucket) GetResDetected added in v1.1.0

func (b *Int64bucket) GetResDetected(cost int64, timer *time.Timer) error

func (*Int64bucket) GetResource

func (b *Int64bucket) GetResource(cost int64) error

func (*Int64bucket) ReleaseResource

func (b *Int64bucket) ReleaseResource(freeResource int64)

!use getResImpl to get resource must use ReleaseResource to release

type ResourceBucket

type ResourceBucket interface {
	ReleaseResource(int64)
	GetResource(int64) error
	GetResDetected(int64, *time.Timer) error
	GetFreeResource() int64
}

func NewInt64Bucket

func NewInt64Bucket(timeOut time.Duration, TotalResource int64, outOfLimitOnce bool) ResourceBucket

Jump to

Keyboard shortcuts

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