task

package
v0.3.3-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	// Before will be called before running this task.
	Before func(ctx context.Context)

	// Fn is main function which will called in loop.
	Fn func(ctx context.Context)

	// After will be called after the task loop.
	After func(ctx context.Context)
}

Task runs a task at fixed duration which will call fn().

func (*Task) Run

func (tt *Task) Run(ctx context.Context, d time.Duration)

Run runs this task at fixed duration d.

Jump to

Keyboard shortcuts

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