task

package
v0.1.13-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropTaskSchedulingEnabled = "task.scheduling.enabled"
	PropTaskSchedulingGroup   = "task.scheduling.group"
)

Variables

This section is empty.

Functions

func IsTaskMaster

func IsTaskMaster(rail miso.Rail) bool

Check if current node is master

func ScheduleDistributedTask

func ScheduleDistributedTask(t miso.Job) error

Schedule a named distributed task

Applications are grouped together as a cluster (each cluster is differentiated by its group name), only the master node can run the Scheduled tasks.

Tasks are pending until StartTaskSchedulerAsync() is called.

E.g.,

job := miso.Job{
	Name:            "Very important task",
	Cron:            "0/1 * * * * ?",
	CronWithSeconds: true,
	Run: MyTask,
}
ScheduleDistributedTask(job)

func SetScheduleGroup

func SetScheduleGroup(groupName string)

Set the schedule group for current node, by default it's 'default'

func StartTaskSchedulerAsync

func StartTaskSchedulerAsync(rail miso.Rail) error

Start distributed scheduler asynchronously

func StartTaskSchedulerBlocking

func StartTaskSchedulerBlocking(rail miso.Rail) error

Start distributed scheduler, current routine is blocked

func StopTaskScheduler

func StopTaskScheduler()

Shutdown distributed job scheduling

Types

This section is empty.

Jump to

Keyboard shortcuts

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