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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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