handler

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

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