task

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

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

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