executor

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalExecutor

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

func NewLocalExecutor

func NewLocalExecutor(maxParallelism, maxQueueSize int) *LocalExecutor

func (*LocalExecutor) Close

func (ex *LocalExecutor) Close() error

func (*LocalExecutor) GetGroupTasks

func (ex *LocalExecutor) GetGroupTasks(groupID interface{}) int

func (*LocalExecutor) Start

func (ex *LocalExecutor) Start()

func (*LocalExecutor) Submit

func (ex *LocalExecutor) Submit(t *Task) bool

func (*LocalExecutor) SubmitAfter

func (ex *LocalExecutor) SubmitAfter(t *Task, after time.Duration) bool

type Task

type Task struct {
	// TaskID is used to ensure that there is only one instance of this task
	TaskID interface{}

	// GroupID is used to group together tasks.
	GroupID interface{}

	// Apply is the work that the task comprises.
	Apply func() error
}

Task is the unit of execution that the executor will execute.

func (*Task) ID

func (t *Task) ID() interface{}

Jump to

Keyboard shortcuts

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