flowctrl

package
v3.0.8-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter interface {
	// TryAccept returns true if a token is taken immediately. Otherwise,
	// it returns false.
	TryAccept() bool

	// Accept will wait and not return unless a token becomes available.
	Accept()

	// QPS returns QPS of this rate limiter
	QPS() int64

	// Burst returns the burst of this rate limiter
	Burst() int64
}

func NewRateLimiter

func NewRateLimiter(qps, burst int64) RateLimiter

Jump to

Keyboard shortcuts

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