taskpool

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

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

Go to latest
Published: Jun 23, 2023 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 IJob

type IJob interface {
	Run()
}

type Option

type Option func(*TaskPool)

func WithTaskConf

func WithTaskConf(conf config.Config) Option

func WithTaskLogger

func WithTaskLogger(log log.Logger) Option

type TaskPool

type TaskPool struct {
	// contains filtered or unexported fields
}
var (
	TaskClient *TaskPool
)

func GetTaskClient

func GetTaskClient() *TaskPool

func NewTaskPool

func NewTaskPool(opts ...Option) *TaskPool

func (*TaskPool) AddJobs

func (t *TaskPool) AddJobs(jobs ...IJob)

func (*TaskPool) Concurrency

func (t *TaskPool) Concurrency() int

func (*TaskPool) Run

func (t *TaskPool) Run()

func (*TaskPool) Stop

func (t *TaskPool) Stop()

func (*TaskPool) WithTaskSize

func (t *TaskPool) WithTaskSize(taskSize int)

Jump to

Keyboard shortcuts

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