semaphore

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EMPTY_PARAMS errors.CodeError = iota + errors.MIN_PKG_Semaphore
	NEW_WORKER
	WAITALL
)

Variables

This section is empty.

Functions

func GetContext

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

func GetEmptyTime

func GetEmptyTime() time.Time

func GetMaxSimultaneous

func GetMaxSimultaneous() int

func IsCodeError

func IsCodeError() bool

Types

type Sem

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

	WaitAll() Error
	Context() context.Context
	Cancel()
}

func NewSemaphore

func NewSemaphore(maxSimultaneous int, timeout time.Duration, deadline time.Time, parent context.Context) Sem

Jump to

Keyboard shortcuts

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