worker

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package worker to run functions like a cronjob in background

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

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

Worker Struct which handles the job

func NewWorker

func NewWorker(every time.Duration, f func()) (w *Worker)

NewWorker create a Worker with a timestamp, run, every and it's function

func (*Worker) Close

func (w *Worker) Close()

Close stops the Worker

func (*Worker) Start

func (w *Worker) Start()

Start the Worker

Jump to

Keyboard shortcuts

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