workerpool

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job interface {
	Do()
}

type Pool

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

func NewPool

func NewPool(workerLen int) *Pool

func (*Pool) Join

func (pool *Pool) Join(job Job)

func (*Pool) Provide

func (pool *Pool) Provide(ctx context.Context) interface{}

func (*Pool) Run

func (pool *Pool) Run()

type Worker

type Worker struct {
	JobQueue chan Job
	Quit     chan struct{}
}

func NewWorker

func NewWorker() *Worker

func (*Worker) Run

func (worker *Worker) Run(wq chan chan Job)

Jump to

Keyboard shortcuts

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