deferred_task

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 15 Imported by: 0

README

Deferred-Task

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &component.Component{
	Dependencies: component.Components{
		runner.Component,
		repeater.Component,
	},
	Init: component.StepFunc(func(container container.Container) error {
		return container.Provides(
			newManager,
			func(m *manager) Manager { return m },
		)
	}),
	Stop: component.StepFunc(func(container container.Container) error {
		return container.Invoke(func(m Manager) error {
			return m.Close()
		})
	}),
}

Functions

This section is empty.

Types

type Manager

type Manager interface {
	io.Closer
	AddTasks(...*Task) error
	AddTask(*Task) error
	StopTaskByName(string) error
	StopTask(*Task) error
	HasTask(*Task) bool
	HasTaskByName(string) bool
}

type Strategy

type Strategy uint8
const (
	One Strategy = iota
	Repeated
)

type Task

type Task struct {
	// contains filtered or unexported fields
}

func NewTask

func NewTask(name string, delay time.Duration, processFunc runner.ProcessFunc, strategy Strategy) *Task

Jump to

Keyboard shortcuts

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