worker

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectWorker

type DirectWorker struct{}

func (DirectWorker) Submit

func (DirectWorker) Submit(task func())

func (DirectWorker) SubmitAndWait

func (DirectWorker) SubmitAndWait(task func())

func (DirectWorker) SubmitBefore

func (DirectWorker) SubmitBefore(task func(), dur time.Duration)

type Pond

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

func CreateNewPond

func CreateNewPond(targetName string) *Pond

func NewPond

func NewPond(max int, poolSize int, workers ...pond.Option) *Pond

func (*Pond) Submit

func (p *Pond) Submit(task func())

func (*Pond) SubmitAndWait

func (p *Pond) SubmitAndWait(task func())

func (*Pond) SubmitBefore

func (p *Pond) SubmitBefore(task func(), dur time.Duration)

type Worker

type Worker interface {
	Submit(task func())
	SubmitAndWait(task func())
	SubmitBefore(task func(), dur time.Duration)
}

func Get

func Get(name ...string) Worker

Jump to

Keyboard shortcuts

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