timer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskFunc

type TaskFunc func() (hasMore bool, err error)

TaskFunc only task function can be added to the timer.

type Timer

type Timer interface {
	AddTask(taskFunc TaskFunc)
	Run()
	Close()
}

Timer is for processing task. it checks buckets for popping jobs. it will put ready jobs to queue.

func New

func New(l log.Logger, taskInterval, taskDelay time.Duration) Timer

New create a new timer for loading ready jobs from bucket

Jump to

Keyboard shortcuts

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