polling

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue signals that an invalid value was provided

View Source
var ErrLoopAlreadyStarted = errors.New("loop already started")

ErrLoopAlreadyStarted signals that a loop has already been started

View Source
var ErrNilExecutor = errors.New("nil executor")

ErrNilExecutor signals that a nil executor instance has been provided

View Source
var ErrNilLogger = errors.New("nil logger")

ErrNilLogger signals that a nil logger was provided

Functions

func NewPollingHandler

func NewPollingHandler(args ArgsPollingHandler) (*pollingHandler, error)

NewPollingHandler will create a new polling handler instance

Types

type ArgsPollingHandler

type ArgsPollingHandler struct {
	Log              logger.Logger
	Name             string
	PollingInterval  time.Duration
	PollingWhenError time.Duration
	Executor         Executor
}

ArgsPollingHandler is the DTO used in the polling handler constructor

type Executor

type Executor interface {
	Execute(ctx context.Context) error
	IsInterfaceNil() bool
}

Executor defines the behavior of a component able to execute a certain task. This will be continuously called by the polling handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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