Documentation ¶
Index ¶
- type Builder
- func (b Builder) AddShutdownHook(hookName string, hook func() error) Builder
- func (b Builder) Build() (*Worker, error)
- func (b Builder) MustBuild() *Worker
- func (b Builder) WithName(n string) Builder
- func (b Builder) WithStopTimeout(t time.Duration) Builder
- func (b Builder) WithWorkStep(s func() error) Builder
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is for configuring a worker
func (Builder) AddShutdownHook ¶
AddShutdownHook registers the hook to be called on shutdown of the worker
func (Builder) MustBuild ¶
MustBuild a Worker with the given configuration. Panics if not all required config is given
func (Builder) WithStopTimeout ¶
WithStopTimeout changes the timeout used when stopping the worker loop. If not set, uses defaultStopTimeout
func (Builder) WithWorkStep ¶
WithWorkStep sets the step func a worker should repeatedly call (required)
Click to show internal directories.
Click to hide internal directories.