ticker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 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 ExitError

type ExitError struct {
	Message string
}

func (ExitError) Error

func (e ExitError) Error() string

type Option

type Option func(d *Ticker)

func WithExecAtBegin

func WithExecAtBegin(exec bool) Option

type Task

type Task func() (finished bool, err error)

type Ticker

type Ticker struct {
	Name     string
	Interval time.Duration
	Task     func() (stop bool, err error)

	ExecAtBegin bool
	// contains filtered or unexported fields
}

func New

func New(interval time.Duration, task Task, opts ...Option) *Ticker

func (*Ticker) Close

func (d *Ticker) Close()

func (*Ticker) Run

func (d *Ticker) Run() error

Jump to

Keyboard shortcuts

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