function

package
v0.0.0-...-3a513bd Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoRetryOption is returned by CanReschedule when a Function has no RetryOptions
	ErrNoRetryOption = errors.New("no retry option")

	// ErrRetryLimitExceded is returned by CanReschedule when a Function has already used all it retries
	ErrRetryLimitExceded = errors.New("retry limit exceded")
)

Functions

This section is empty.

Types

type Function

type Function struct {
	Name string        `json:"name"`
	Args []interface{} `json:"args,omitempty"`
	//TODO: Delay time.Duration // To Delay a task
	RetryCount   int32         `json:"retry_count"`
	RetryOptions *RetryOptions `json:"retry_options,omitempty"`
}

Function represents a Job function

func (*Function) CanReschedule

func (f *Function) CanReschedule() error

CanReschedule returns an error if this function cannot be rescheduled See returned error for exact reason

func (*Function) IncrRetryCount

func (f *Function) IncrRetryCount()

type RetryOptions

type RetryOptions struct {
	RetryLimit int32 `json:"retry_limit"`
}

RetryOptions define retry policy for a given Function

Jump to

Keyboard shortcuts

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