sched

package
v0.0.0-...-fd2add7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sched contains primitives for scheduling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quota

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

Quota behaves like sync.Mutex, except it allows up to a given limit of concurrent lock holders.

func NewQuota

func NewQuota(m int) *Quota

NewQuota creates a new quota with limit m.

func (*Quota) Begin

func (q *Quota) Begin() error

Lock blocks until there are fewer than limit unclosed sessions. A session begins when Open returns.

func (*Quota) Close

func (q *Quota) Close()

func (*Quota) End

func (q *Quota) End()

End undoes one previous Begin.

func (*Quota) Init

func (q *Quota) Init(m int) *Quota

Init resets this limiter and sets its limit to m.

Directories

Path Synopsis
Package limiter schedules job execution while maintaining an upper limit on concurrency
Package limiter schedules job execution while maintaining an upper limit on concurrency

Jump to

Keyboard shortcuts

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