workpool

package
v0.0.0-...-6ffc9e3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoWorkFunc

type DoWorkFunc func(ctx context.Context, args ...interface{})

func (DoWorkFunc) DoWork

func (f DoWorkFunc) DoWork(ctx context.Context, args ...interface{})

type Work

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

func NewWork

func NewWork(worker Worker, args ...interface{}) *Work

func NewWorkFunc

func NewWorkFunc(doworkfn DoWorkFunc, args ...interface{}) *Work

type Worker

type Worker interface {
	DoWork(ctx context.Context, args ...interface{})
}

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(works int) *WorkerPool

func (*WorkerPool) PutBlocking

func (wp *WorkerPool) PutBlocking(work *Work)

func (*WorkerPool) PutWithContext

func (wp *WorkerPool) PutWithContext(ctx context.Context, work *Work)

func (*WorkerPool) Start

func (wp *WorkerPool) Start(ctx context.Context)

func (*WorkerPool) Stop

func (wp *WorkerPool) Stop()

Jump to

Keyboard shortcuts

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