bglimiter

package
v0.0.0-...-c6fdbb4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundLimiter

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

func New

func New() *BackgroundLimiter

New returns a new runner with no limits.

func NewWithContext

func NewWithContext(ctx context.Context, limit int) *BackgroundLimiter

NewWithContext returns a new runner with the given parent context and limit, if limit is <= 0 it won't have a limit.

func (*BackgroundLimiter) Add

func (bg *BackgroundLimiter) Add(fn func(ctx context.Context) error) <-chan error

func (*BackgroundLimiter) AddWithTimeout

func (bg *BackgroundLimiter) AddWithTimeout(fn func(ctx context.Context) error, timeout time.Duration) <-chan error

func (*BackgroundLimiter) Close

func (bg *BackgroundLimiter) Close() error

func (*BackgroundLimiter) Context

func (bg *BackgroundLimiter) Context() context.Context

func (*BackgroundLimiter) IsCanceled

func (bg *BackgroundLimiter) IsCanceled() bool

func (*BackgroundLimiter) Wait

func (bg *BackgroundLimiter) Wait()

func (*BackgroundLimiter) WaitWithContext

func (bg *BackgroundLimiter) WaitWithContext(ctx context.Context) error

Jump to

Keyboard shortcuts

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