quota

package
v0.0.0-...-3f1ab7e Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrencyQuota

type ConcurrencyQuota interface {
	Consume(ctx context.Context) error
	TryConsume() bool
	Release()
}

ConcurrencyQuota abstracts an interface that supports acquire and release quota concurrently

func NewConcurrencyQuota

func NewConcurrencyQuota(total int64) ConcurrencyQuota

NewConcurrencyQuota creates a new concurrencyQuotaImpl instance that implements ConcurrencyQuota interface

Jump to

Keyboard shortcuts

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