taskman

package module
v0.0.0-...-c135731 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 4 Imported by: 0

README

taskman

Documentation

Index

Constants

View Source
const (
	DefConcurrency = 16
)

Variables

View Source
var (
	NoSuchTaskNameErr = errors.New("no such task name")
	TaskNotFoundErr   = errors.New("task not found")
	TaskIsRunningErr  = errors.New("task is running")
	TaskIsStoppedErr  = errors.New("task is stopped")
)

Functions

This section is empty.

Types

type NewTaskFunc

type NewTaskFunc func(data []byte) (Task, error)

type Task

type Task interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
	Init(ctx context.Context) (int64, error)
	Deinit(ctx context.Context) error
	// Return values:
	// int64: next step index
	// bool: if task is done
	// []byte: result when it's done
	// error
	Step(ctx context.Context, current int64) (int64, bool, []byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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