gate

package
v0.12.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

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

Gate wraps the Prometheus gate with extra metrics.

func NewGate

func NewGate(maxConcurrent int, reg prometheus.Registerer) *Gate

NewGate returns a new query gate.

func (*Gate) Done

func (g *Gate) Done()

Done finishes a query.

func (*Gate) IsMyTurn

func (g *Gate) IsMyTurn(ctx context.Context) error

IsMyTurn iniates a new query and waits until it's our turn to fulfill a query request.

type Gater added in v0.11.0

type Gater interface {
	IsMyTurn(ctx context.Context) error
	Done()
}

Jump to

Keyboard shortcuts

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