task

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameters

type Parameters struct {
	Name     string
	Function func() error
	Logger   good.Logger
}

Parameters are used to configure a task.

type RecurringTask

type RecurringTask struct {
	Name string
	// contains filtered or unexported fields
}

RecurringTask represents an asychronous repeating task.

func New

func New(p Parameters) *RecurringTask

New returns a new recurring task.

func (*RecurringTask) Start

func (t *RecurringTask) Start(interval time.Duration)

Start starts the task in the background, running it at the defined interval.

func (*RecurringTask) Stop

func (t *RecurringTask) Stop()

Stop stops the task routine.

func (*RecurringTask) Trigger

func (t *RecurringTask) Trigger()

Trigger triggers the task manually.

Jump to

Keyboard shortcuts

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