executor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

func (*Executor) Cancel

func (e *Executor) Cancel(id int, job *model2.Job) error

Cancel 取消

func (*Executor) Execute

func (e *Executor) Execute(id int, job *model2.Job) error

Execute 执行任务

func (*Executor) FetchJob

func (e *Executor) FetchJob(name string) (io.Reader, error)

FetchJob 获取任务

func (*Executor) HandlerLog

func (e *Executor) HandlerLog(jobId int)

HandlerLog 处理日志

func (*Executor) SendResultToQueue

func (e *Executor) SendResultToQueue(channel chan model2.StatusChangeMessage, job *model2.JobDetail)

SendResultToQueue 发送结果到队列

type ExecutorClient

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

func NewExecutorClient

func NewExecutorClient(channel chan model2.QueueMessage, callbackChannel chan model2.StatusChangeMessage, jobService service.IJobService) *ExecutorClient

func (*ExecutorClient) Execute

func (c *ExecutorClient) Execute(jobId int, job *model2.Job) error

func (*ExecutorClient) Main

func (c *ExecutorClient) Main()

type IExecutor

type IExecutor interface {

	// FetchJob 获取任务
	FetchJob(name string) (io.Reader, error)

	// Execute 执行任务
	Execute(id int, job *model2.Job) error

	// HandlerLog 处理日志
	HandlerLog(jobId int)

	//SendResultToQueue 发送结果到队列
	SendResultToQueue(channel chan model2.StatusChangeMessage, jobWrapper *model2.JobDetail)

	Cancel(id int, job *model2.Job) error
}

Jump to

Keyboard shortcuts

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