handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(h Interface) string

Name returns the package declaration of the given handler implementation.

func Names

func Names(han []Interface) []string

Names returns the list of worker handler names matching the given list of worker handler interfaces. E.g. this function should enable the metrics registry to whitelist all injected worker handlers automatically.

Types

type Interface

type Interface interface {
	// Cooler is the amount of time that any given handler specifies to wait
	// before being executed again. This is not an interval on a strict schedule.
	// This is simply the time to sleep after execution, before another cycle
	// repeats.
	Cooler() time.Duration

	// Ensure executes the handler specific business logic in order to complete
	// the given task, if possible. Any error returned will be emitted using the
	// underlying logger interface. Calling this method will not interfere with
	// the execution of other handlers, because every handler is managed within
	// its own pipeline to guarantee isolated failure domains.
	Ensure() error
}

Interface describes asynchronous worker handlers that are executed iteratively by a custom task engine. New worker handlers can be created by implementing this handler interface and registering the handler instance with the respective worker engine.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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