executor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterExecutor

func RegisterExecutor(taskType string, ce Interface)

Types

type Interface

type Interface interface {
	// (async) Run will create a executor's instance to run task and return standard results after completion.
	// The executor running inside the worker program recommends processing ctx.Done for gracefully exit.
	Run(task *model.TaskExecParam) error
	// (async) Pause a executor, the task will stop running and become suspended, and can be run again;
	Pause(taskKey string) error
	// (async) Resume a executor.
	Resume(taskKey string) error
	// (async) graceful Exit a executor. The task will stop running and become terminated, and cannot be restarted.
	Stop(taskKey string) error
	// (async) fore Exit.
	Exit(taskKey string) error

	List(ctx context.Context) ([]*model.TaskExecResult, error)
	ChangeResult() <-chan *model.TaskExecResult
}

Interface is the interface of the executor.

type Manager

type Manager struct{}

func (*Manager) ChangeHandle

func (ge *Manager) ChangeHandle(change *model.Change) error

func (*Manager) ChangeResult

func (ge *Manager) ChangeResult() <-chan *model.TaskExecResult

func (*Manager) List

func (ge *Manager) List(ctx context.Context) ([]*model.TaskExecResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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