Categorygithub.com/go-nacelle/workerbase
modulepackage
1.0.2
Repository: https://github.com/go-nacelle/workerbase.git
Documentation: pkg.go.dev

# README

Nacelle Base Worker Process GoDoc CircleCI Coverage Status

Abstract worker process for nacelle.


Usage

The supplied process is an abstract busy-loop whose behavior is determined by a supplied WorkerSpec interface. This interface has an Init method that receives application config and a Tick method where each phase of work should be done. The tick method is passed a context that will be canceled on shutdown so that any long-running work can be cleanly abandoned. There is an example included in this repository.

  • WithTagModifiers registers the tag modifiers to be used when loading process configuration (see below). This can be used to change the default tick interval, or prefix all target environment variables in the case where more than one worker process is registered per application.

Configuration

The default process behavior can be configured by the following environment variables.

Environment VariableDefaultDescription
WORKER_STRICT_CLOCKfalseSubtract the duration of the previous tick from the time between calls to the spec's tick function.
WORKER_TICK_INTERVAL0The time (in seconds) between calls to the spec's tick function.

# Functions

No description provided by the author
WithTagModifiers applies the given tag modifiers on config load.

# Structs

No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author