executor

package
v0.11.15 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulStop

func GracefulStop() error

GracefulStop ...

func Register

func Register(address string, e Executor)

注册执行器到jupiter

func Run

func Run() error

Run ...

func Stop

func Stop() error

Stop ...

Types

type Executor

type Executor interface {
	GetAddress() string   // 执行性标识
	RegXJob(jobs ...XJob) // 注册执行器任务
	Run() error           // 启动执行器
	Stop()                // 退出执行器,向调度中心取消注册
	GracefulStop()        // 优雅地退出执行器,向调度中心取消注册
}

执行器接口

type RunReq

type RunReq struct {
	JobID                 int64  `json:"jobId"`                 // 任务ID
	ExecutorHandler       string `json:"executorHandler"`       // 任务标识
	ExecutorParams        string `json:"executorParams"`        // 任务参数
	ExecutorBlockStrategy string `json:"executorBlockStrategy"` // 任务阻塞策略
	ExecutorTimeout       int64  `json:"executorTimeout"`       // 任务超时时间,单位秒,大于零时生效
	LogID                 int64  `json:"logId"`                 // 本次调度日志ID
	LogDateTime           int64  `json:"logDateTime"`           // 本次调度日志时间
	GlueType              string `json:"glueType"`              // 任务模式,可选值参考 com.xxl.job.core.glue.GlueTypeEnum
	GlueSource            string `json:"glueSource"`            // GLUE脚本代码
	GlueUpdateTime        int64  `json:"glueUpdatetime"`        // GLUE脚本更新时间,用于判定脚本是否变更以及是否需要刷新
	BroadcastIndex        int64  `json:"broadcastIndex"`        // 分片参数:当前分片
	BroadcastTotal        int64  `json:"broadcastTotal"`        // 分片参数:总分片
}

触发任务请求参数

type XJob

type XJob interface {
	Run(ctx context.Context, param *RunReq) (msg string, err error)
	GetJobName() string
}

XJob 定时任务接口

Directories

Path Synopsis
xxl

Jump to

Keyboard shortcuts

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