handler

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create[TM any, SD any](data *SD, hf func(context.Context, *TM, *SD) error, opts *Opts[TM]) gue.WorkFunc

CreateHandler helper func to wrapp gue worker main func

func DefaultBackoff

func DefaultBackoff() gue.Backoff

func DefaultBackoffOrTest

func DefaultBackoffOrTest(test bool) gue.Backoff

func NoBackoff

func NoBackoff() gue.Backoff

Types

type MsgSender

type MsgSender interface {
	SendMessage(context.Context, amessages.Message, string) error
}

MsgSender provides send msg functionality

type Opts

type Opts[TM any] struct {
	// contains filtered or unexported fields
}

func DefaultOpts

func DefaultOpts[TM any]() *Opts[TM]

func (*Opts[TM]) WithBackoff

func (o *Opts[TM]) WithBackoff(b gue.Backoff) *Opts[TM]

func (*Opts[TM]) WithFailure

func (o *Opts[TM]) WithFailure(failureHandler func(context.Context, *TM, error, *gue.Job) (bool, time.Duration, error)) *Opts[TM]

func (*Opts[TM]) WithTimeout

func (o *Opts[TM]) WithTimeout(timeout time.Duration) *Opts[TM]

Jump to

Keyboard shortcuts

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