semaphore

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorParamsEmpty errors.CodeError = iota + errors.MinPkgSemaphore
	ErrorWorkerNew
	ErrorWorkerWaitAll
)

Variables

This section is empty.

Functions

func EmptyTime added in v1.3.0

func EmptyTime() time.Time

func GetMaxSimultaneous

func GetMaxSimultaneous() int

func IsCodeError

func IsCodeError() bool

func NewContext added in v1.3.0

func NewContext(parent context.Context, timeout time.Duration, deadline time.Time) (ctx context.Context, cancel context.CancelFunc)

Types

type Sem

type Sem interface {
	NewWorker() errors.Error
	NewWorkerTry() bool
	DeferWorker()
	DeferMain()

	WaitAll() errors.Error
}

func NewSemaphore

func NewSemaphore(maxSimultaneous int) Sem

func NewSemaphoreWithContext added in v1.3.0

func NewSemaphoreWithContext(ctx context.Context, maxSimultaneous int) Sem

Jump to

Keyboard shortcuts

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