tasks

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package tasks in an experimental package which serves as an extension that lets users run a function at a specified interval

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

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

Task represents a task that will run a function at a specified interval

func (*Task) Start

func (t *Task) Start()

Start starts the task

func (*Task) Stop

func (t *Task) Stop()

Stop stops the running task

type TaskManager

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

TaskManager represents a manager that holds the different tasks

func NewTaskManager

func NewTaskManager() *TaskManager

NewTaskManager creates a new task manager with empty tasks

func (*TaskManager) GetTasks

func (m *TaskManager) GetTasks() []*Task

GetTasks returns all the tasks the manager holds

func (*TaskManager) NewTask

func (m *TaskManager) NewTask(do func(), every time.Duration) *Task

NewTask creates a new task to run at the specified interval

Jump to

Keyboard shortcuts

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