semaphore

package
v1.11.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorParamEmpty liberr.CodeError = iota + liberr.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 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 FuncContext added in v1.9.4

type FuncContext func() context.Context

type Sem

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

	WaitAll() liberr.Error
}

func NewSemaphore deprecated

func NewSemaphore(maxSimultaneous int) Sem

Deprecated: func without context will be deprecated

func NewSemaphoreWithContext added in v1.3.0

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

type SemBar added in v1.9.4

type SemBar interface {
	Sem

	Current() int64
	Completed() bool
	Reset(total, current int64)
	ResetDefined(current int64)
	Done()

	Increment(n int)
	Increment64(n int64)
}

Jump to

Keyboard shortcuts

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