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 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.

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