Documentation
¶
Overview ¶
redis-based distributed task scheduling
Index ¶
Constants ¶
View Source
const ( // misoconfig-prop: enable distributed task scheduling | true PropTaskSchedulingEnabled = "task.scheduling.enabled" // misoconfig-prop: name of the cluster | `"${app.name}"` PropTaskSchedulingGroup = "task.scheduling.group" // misoconfig-prop: disable specific task by it's name | false // misoconfig-doc-only PropTaskSchedulingTaskDisabled = "task.scheduling.${taskName}.disabled" )
misoconfig-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.