invoker

package
v0.0.0-...-d828794 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IInvoker

type IInvoker interface {
	Execute()
	ReloadTaskConfig(taskConfig *model.TaskConfig)
	StopRunning() <-chan bool
	Start()
	GetShard() int32
}

func NewRtTaskInvoker

func NewRtTaskInvoker(ctx context.Context, task *model.TaskConfig, node string, shard string, rtTasks []RtTask) IInvoker

type RtBaseInvoker

type RtBaseInvoker struct {
	LogPrefix     string
	ServerAddress string
	// contains filtered or unexported fields
}

RtBaseInvoker implementations:

StopRunning(),Start(),GetShard()

not implemented:

Execute(),ReloadTaskConfig()

func (*RtBaseInvoker) GetShard

func (r *RtBaseInvoker) GetShard() int32

func (*RtBaseInvoker) Start

func (r *RtBaseInvoker) Start()

func (*RtBaseInvoker) StopRunning

func (r *RtBaseInvoker) StopRunning() <-chan bool

type RtTask

type RtTask interface {
	// Take get task records by taskConfig and shard
	Take() []*Task

	// Execute execute logic for each task record
	// Result: true: execute success
	Execute(*Task) bool
}

type RtTaskInvoker

type RtTaskInvoker struct {
	RtBaseInvoker
	// contains filtered or unexported fields
}

func (*RtTaskInvoker) Execute

func (r *RtTaskInvoker) Execute()

func (*RtTaskInvoker) ReloadTaskConfig

func (r *RtTaskInvoker) ReloadTaskConfig(taskConfig *model.TaskConfig)

type Task

type Task struct {
	Id           uint64
	Type         uint32
	Status       uint32
	Started      bool
	ExecuteTime  int32
	ExecuteCount uint32
	BizId        string
	BizParam     string
	Part         int32
	CreateTime   int32
	UpdateTime   int32
}

Task identify a normal task

Jump to

Keyboard shortcuts

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