task

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package task provides interval-based task scheduling functionality.

Deprecated: Use cronjob package instead for more flexible cron-based scheduling. The cronjob package supports cron expressions and provides better control over task execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init deprecated

func Init() error

Init initializes the task scheduler and starts all registered tasks.

Deprecated: Use cronjob.Init() instead for cron-based task scheduling.

func Register deprecated

func Register(fn func() error, interval time.Duration, name string)

Register registers a task with the given function, interval, and name. The task can be registered at any point before or after Init().

Deprecated: Use cronjob.Register() instead for more flexible cron-based scheduling. Example migration:

// Old: task.Register(fn, 5*time.Minute, "my-task")
// New: cronjob.Register(fn, "0 */5 * * * *", "my-task")

Types

This section is empty.

Jump to

Keyboard shortcuts

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