task

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	common.Service
	common.Daemon
	Add(tasks ...*Task) error
	Remove(tasks ...*Task)
	Stats(id string) *executor.Stats
}

func New

func New(opts ...Option) Manager

type Option

type Option func(*manager)

func MaxConcurrency

func MaxConcurrency(size int) Option

func WithLogger

func WithLogger(logger log.Logger) Option

type Task

type Task struct {
	Job           job.Job         `json:"-"`
	Ctx           context.Context `json:"-"`
	Params        any             `json:"params"`
	Schedule      string          `json:"schedule"`
	Priority      int             `json:"priority"`
	Exclusive     bool            `json:"exclusive"`
	Timeout       time.Duration   `json:"timeout,omitempty"`
	Cooldown      time.Duration   `json:"cooldown,omitempty"`
	Once          bool            `json:"once"`
	RetryAttempts int             `json:"retry_attempts,omitempty"`
	RetryDelay    time.Duration   `json:"retry_delay,omitempty"`
}

func (*Task) GetPriority

func (t *Task) GetPriority() int

func (*Task) IsValid

func (t *Task) IsValid() bool

func (*Task) Key

func (t *Task) Key() string

func (*Task) SetPriority

func (t *Task) SetPriority(priority int)

func (*Task) String

func (t *Task) String() string

Jump to

Keyboard shortcuts

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