models

package
v0.1.5-beta Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultErrTimeoutSec = 10

Default time period after error occurs

View Source
var DefaultPeekTimeoutSec = 10

Default spap in retry cycle (in addition to duration of job lock)

Functions

This section is empty.

Types

type Job

type Job struct {
	Lock lockmodels.Lock

	// Job action
	Action JobAction

	// Span in retry cycle (in addition to duration of job lock)
	PeekTimeoutSec int
	// Time period after error occurs
	ErrTimeoutSec int

	// Error handler
	ErrHandler JobErrorHandler
}

func NewJob

func NewJob(
	lock lockmodels.Lock,
	action JobAction,
	errHandler JobErrorHandler,
) (job Job, err error)

func NewJobEx

func NewJobEx(
	lock lockmodels.Lock,
	action JobAction,
	peekTimeoutSec int,
	errTimeoutSec int,
	errHandler JobErrorHandler,
) (job Job, err error)

func NewJobExPnc

func NewJobExPnc(
	lock lockmodels.Lock,
	action JobAction,
	peekTimeoutSec int,
	errTimeoutSec int,
	errHandler JobErrorHandler,
) (job Job)

func NewJobPnc

func NewJobPnc(
	lock lockmodels.Lock,
	action JobAction,
	errHandler JobErrorHandler,
) (job Job)

func (Job) Validate

func (j Job) Validate() (err error)

type JobAction

type JobAction func(context.Context, Job) error

type JobErrorHandler

type JobErrorHandler func(context.Context, Job, error)

Jump to

Keyboard shortcuts

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