gate

package
v2.5.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

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
}

A Gate controls the maximum number of concurrently running and waiting queries.

func New

func New(length int) *Gate

NewGate returns a query gate that limits the number of queries being concurrently executed.

func (*Gate) Done

func (g *Gate) Done()

Done releases a single spot in the gate.

func (*Gate) Start

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

Start blocks until the gate has a free spot or the context is done.

Jump to

Keyboard shortcuts

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