Documentation
¶
Index ¶
- Constants
- func DistriTaskBootstrap(rail miso.Rail) error
- func IsTaskMaster(rail miso.Rail) bool
- func IsTaskSchedulingDisabled() bool
- func ScheduleDistributedTask(t miso.Job) error
- func SetScheduleGroup(groupName string)
- func StartTaskSchedulerAsync(rail miso.Rail) error
- func StartTaskSchedulerBlocking(rail miso.Rail) error
- func StopTaskScheduler()
Constants ¶
View Source
const ( PropTaskSchedulingEnabled = "task.scheduling.enabled" PropTaskSchedulingGroup = "task.scheduling.group" )
Variables ¶
This section is empty.
Functions ¶
func DistriTaskBootstrap ¶
func IsTaskSchedulingDisabled ¶
func IsTaskSchedulingDisabled() bool
Check if it's disabled (based on configuration, doesn't affect method call)
func ScheduleDistributedTask ¶
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 ¶
Start distributed scheduler asynchronously
func StartTaskSchedulerBlocking ¶
Start distributed scheduler, current routine is blocked
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.