taskengine

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task interface {
	Run()
}

Task define the task interface

type TaskEngine

type TaskEngine struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

TaskEngine define the task engine

func New

func New(ctx context.Context, name string, concurrencyLevel int, logger *zap.Logger) *TaskEngine

New create a new task engine

func (*TaskEngine) Schedule

func (engine *TaskEngine) Schedule(task Task) bool

Schedule schedule a task running on engine

func (*TaskEngine) Shutdown

func (engine *TaskEngine) Shutdown()

Shutdown stop the task engine

type TaskFunc

type TaskFunc func()

TaskFunc define the task func type

func (TaskFunc) Run

func (f TaskFunc) Run()

Run implements the Task interface

Jump to

Keyboard shortcuts

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