task

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchExec

func BatchExec(ctx context.Context, taskGroup string, in ...Task) map[string]interface{}

func Exec

func Exec(ctx context.Context, taskGroup string, in Task) (interface{}, error)

func RegisterTaskGroup

func RegisterTaskGroup(taskGroup string, method func(...Task) (map[string]interface{}, error), opt *Option)

Types

type GroupTask

type GroupTask interface {
	GroupBy() string
}

type MergeTask

type MergeTask interface {
	MergeBy() string
}

type Option

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

func DefaultOption

func DefaultOption() *Option

func (*Option) WithBatchSize

func (opt *Option) WithBatchSize(batchSize int) *Option

func (*Option) WithMaxWoker

func (opt *Option) WithMaxWoker(max int) *Option

func (*Option) WithTimeRange added in v0.2.21

func (opt *Option) WithTimeRange(timeRange int) *Option

ms

type Task

type Task interface {
	UniqueId() string //must unique id
}

Jump to

Keyboard shortcuts

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