Documentation
¶
Index ¶
Constants ¶
View Source
const ( // misoapi-config: enable distributed task scheduling | true PropTaskSchedulingEnabled = "task.scheduling.enabled" // misoapi-config: name of the cluster | `${app.name}` PropTaskSchedulingGroup = "task.scheduling.group" )
misoapi-config-section: Distributed Task Scheduling Configuration
Variables ¶
This section is empty.
Functions ¶
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.