limit

package module
v0.0.0-...-68ac4bb Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: Apache-2.0 Imports: 2 Imported by: 1

README

limit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit

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

Limit 并发阻塞, 安全退出

func New

func New(opts ...Option) *Limit

New create LimitWaitGroup

func (*Limit) Add

func (l *Limit) Add(delta int)

Add add

func (*Limit) Close

func (l *Limit) Close() error

Close close

func (*Limit) Do

func (l *Limit) Do(Func func())

Do execute

func (*Limit) Done

func (l *Limit) Done()

Done done

func (*Limit) Len

func (l *Limit) Len() int

Len len

func (*Limit) Stat

func (l *Limit) Stat() string

Stat limit stat

func (*Limit) Wait

func (l *Limit) Wait()

Wait wait

type Option

type Option func(o *Options)

Option opt func

func Max

func Max(max int) Option

Max max

type Options

type Options struct {
	Max int
}

Options Limit Package config

Jump to

Keyboard shortcuts

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