worker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Env is the environment identifier injected to the internally managed
	// registry interface to annotate all metrics with the respective label, e.g.
	// "env=staging".
	Env string

	// Fil is an optional error matcher to ignore certain errors returned by the
	// executed worker handlers, in order to suppress their associated error logs.
	// All errors will be logged by default.
	Fil func(error) bool

	// Han is the list of worker handlers implementing the actual business logic.
	// The worker handlers configured here may be wrapped in administrative
	// handler implementations to e.g. instrument handler execution latency and
	// handler error rates. All worker handlers provided here will be executed
	// concurrently within their own isolated failure domain.
	Han []handler.Interface

	// Log is a standard logger interface to forward structured log messages to
	// any output interface e.g. stdout.
	Log logger.Interface

	// Met is the open telemetry meter interface injected to the internally
	// managed registry interface. This meter will record all worker handler
	// execution metrics.
	Met metric.Meter
}

type Worker

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

func New

func New(c Config) *Worker

func (*Worker) Daemon

func (w *Worker) Daemon()

Jump to

Keyboard shortcuts

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