timer

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QueueMutex sync.Mutex
	QueueMap   = map[string]*QueueTrigger{}
)

Functions

func QueueSendTask

func QueueSendTask(ctx context.Context, svcCtx *svc.ServiceContext, topic string, payload string, po *relationDB.TimedTaskInfo) error

func QueueTaskCheck

func QueueTaskCheck(svcCtx *svc.ServiceContext)

定时任务检查

func QueueTaskClose

func QueueTaskClose(ctx context.Context, taskCode string)

func QueueTaskStatusRunCheck

func QueueTaskStatusRunCheck(ctx context.Context, svcCtx *svc.ServiceContext, wait *sync.WaitGroup, task *relationDB.TimedTaskInfo) error

需要检查任务是否启动,如果没有启动需要启动

func QueueTaskStatusStopCheck

func QueueTaskStatusStopCheck(ctx context.Context, svcCtx *svc.ServiceContext, wait *sync.WaitGroup, task *relationDB.TimedTaskInfo) error

如果处于运行状态需要停止

func Run

func Run(svcCtx *svc.ServiceContext)

func TimingTaskCheck

func TimingTaskCheck(svcCtx *svc.ServiceContext)

定时任务检查

func TimingTaskStatusRunCheck

func TimingTaskStatusRunCheck(ctx context.Context, svcCtx *svc.ServiceContext, wait *sync.WaitGroup, task *relationDB.TimedTaskInfo) error

需要检查任务是否启动,如果没有启动需要启动

func TimingTaskStatusStopCheck

func TimingTaskStatusStopCheck(ctx context.Context, svcCtx *svc.ServiceContext, wait *sync.WaitGroup, task *relationDB.TimedTaskInfo) error

如果处于运行状态需要停止

Types

type QueueTrigger

type QueueTrigger struct {
	Subs []*nats.Subscription
	Task *relationDB.TimedTaskInfo
}

Jump to

Keyboard shortcuts

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