run

package
v0.0.0-...-7eb9a9b Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_JOB_QUEUE_SIZE = 50
	MAX_IDLE_TIMES         = 30
)
View Source
const (
	TASK_STATUS_INQUEUE      = "in_queque"      // 等待执行
	TASK_STATUS_RUNNING      = "running"        // 执行中
	TASK_STATUS_RUN_COMPLETE = "run_complete"   // 执行完成
	TASK_STATUS_WAIT_RESULT  = "wait_result"    //等待异步结果
	TASK_STATUS_SEND_RESULT  = "sending_result" // 上报执行结果中
	TASK_STATUS_END          = "end"            // 结束
	TASK_STATUS_KILLED       = "killed"         // 被杀死

)

Variables

View Source
var (
	JobHandlerRepository sync.Map // bean name -> *IJobHandler
	JobRunnerRepository  sync.Map // jobId -> *JobRunner
)

Functions

func AddJobHandler

func AddJobHandler(executorHandler string, handler handler.IJobHandler)

func GetJobHandler

func GetJobHandler(executorHandler string) handler.IJobHandler

func RemoveJobHandler

func RemoveJobHandler(executorHandler string)

Types

type JobRunner

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

func AddJobRunner

func AddJobRunner(jobId int32, handler handler.IJobHandler, triggerCallback *proccess.TriggerCallbackProccessor) *JobRunner

func GetJubRunner

func GetJubRunner(jobId int32) *JobRunner

func NewJobRunner

func NewJobRunner(jobId int32, jobHandler handler.IJobHandler, triggerCallback *proccess.TriggerCallbackProccessor) *JobRunner

func RemoveJobRunner

func RemoveJobRunner(jobId int32) *JobRunner

func (*JobRunner) IsRunningOrHasQueue

func (t *JobRunner) IsRunningOrHasQueue() bool

func (*JobRunner) PushTriggerQueue

func (t *JobRunner) PushTriggerQueue(triggerParam TriggerParam)

func (*JobRunner) Run

func (t *JobRunner) Run(triggerParam TriggerParam)

func (*JobRunner) Start

func (t *JobRunner) Start()

func (*JobRunner) Stop

func (t *JobRunner) Stop()

Jump to

Keyboard shortcuts

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