asyncworker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FinishTablePrefix = "FT"
)

Variables

View Source
var (
	// ErrRetry从TaskHandler返回指示这次任务应该被重试
	ErrRetry = errors.New("retry task")
)
View Source
var (
	UnmarshalFunc = json.Unmarshal
)

Functions

This section is empty.

Types

type AsyncWorker

type AsyncWorker interface {
	RegisterHandler(contract string, event string, handler func(ctx common.TaskContext) error)
}

type AsyncWorkerImpl

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

func NewAsyncWorkerImpl

func NewAsyncWorkerImpl(bcName string, e common.Engine, baseDB kvdb.Database) (*AsyncWorkerImpl, error)

func (*AsyncWorkerImpl) RegisterHandler

func (aw *AsyncWorkerImpl) RegisterHandler(contract string, event string, handler common.TaskHandler)

func (*AsyncWorkerImpl) Start

func (aw *AsyncWorkerImpl) Start() (err error)

func (*AsyncWorkerImpl) Stop

func (aw *AsyncWorkerImpl) Stop()

type TaskContextImpl

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

func (*TaskContextImpl) ParseArgs

func (tc *TaskContextImpl) ParseArgs(v interface{}) error

func (*TaskContextImpl) RetryTimes

func (tc *TaskContextImpl) RetryTimes() int

Jump to

Keyboard shortcuts

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