task

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncTaskService

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

func (*AsyncTaskService) Add

func (lat *AsyncTaskService) Add(ctx context.Context, task Task) error

func (*AsyncTaskService) LatestHandled

func (lat *AsyncTaskService) LatestHandled(key string) (Task, error)

func (*AsyncTaskService) Ready

func (lat *AsyncTaskService) Ready() <-chan struct{}

func (*AsyncTaskService) Run

func (lat *AsyncTaskService) Run()

func (*AsyncTaskService) Stop

func (lat *AsyncTaskService) Stop()

type Executor

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

func NewExecutor

func NewExecutor(pool *gopool.Pool, task Task) *Executor

func (*Executor) AddTask

func (s *Executor) AddTask(task Task) (err error)

func (*Executor) Close

func (s *Executor) Close()

func (*Executor) Execute

func (s *Executor) Execute()

type Service

type Service interface {
	Add(ctx context.Context, task Task) error
	LatestHandled(key string) (Task, error)

	Run()
	Stop()
	Ready() <-chan struct{}
}

func GetService

func GetService() Service

func NewTaskService

func NewTaskService() Service

type Task

type Task interface {
	Key() string
	Do(ctx context.Context) error
	Err() error
}

Jump to

Keyboard shortcuts

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