tasks

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Effector

type Effector func(context.Context, Task) error

func Retry

func Retry(effector Effector, retries int, delay time.Duration) Effector

type Task

type Task interface {
	Name() string
	Run(ctx context.Context) error
}

Runnable task

func NewTask

func NewTask(name string, action TaskAction) Task

type TaskAction

type TaskAction func(ctx context.Context) error

type TaskRunner

type TaskRunner interface {
	Add(task Task)
	Start() error
}

func NewTaskRunner

func NewTaskRunner() TaskRunner

type TaskType

type TaskType string
const (
	RunnableTask TaskType = "FireAndForgetTask"
)

Jump to

Keyboard shortcuts

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