async

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MPL-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 DoWorkFn

type DoWorkFn func() error

type Worker

type Worker struct {
	Delay time.Duration // Delay between doWork calls
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(fn DoWorkFn) *Worker

func (*Worker) Cancel

func (w *Worker) Cancel()

Cancel stops the worker

func (*Worker) Done

func (w *Worker) Done() <-chan struct{}

Done is closed when the work loop ended

func (*Worker) Error

func (w *Worker) Error() error

func (*Worker) Start

func (w *Worker) Start()

Start starts the worker, does nothing when already running

Jump to

Keyboard shortcuts

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