model

package
v0.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobFunction

type JobFunction func(ctx context.Context, args map[string]string) error

JobFunction is the signature for functions that workers can call to asynchronously execute a job

type Task

type Task interface {
	GetID() string
	GetJobName() string
	GetArgs() map[string]string
	GetWorkerRejectionCount() int
	IncrementWorkerRejectionCount() int
	ToJSON() ([]byte, error)
}

Task is an interface to be implemented by types that represent a single asynchronous task

func NewTask

func NewTask(jobName string, args map[string]string) Task

NewTask returns a new task

func NewTaskFromJSON

func NewTaskFromJSON(jsonBytes []byte) (Task, error)

NewTaskFromJSON returns a new Task unmarshalled from the provided []byte

Jump to

Keyboard shortcuts

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