asyncjob

package
v0.0.0-...-699dfa3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfg Config) (machineryServer *machinery.Server, err error)

manual init

func NewBlankBackend

func NewBlankBackend() iface.Backend

NewBlankBackend creates blank Backend instance

Types

type Backend

type Backend struct {
	common.Backend
}

refer: https://github.com/RichardKnop/machinery/issues/325 Backend represents a "blank" result backend

func (*Backend) GetState

func (b *Backend) GetState(taskUUID string) (*tasks.TaskState, error)

GetState returns the latest task state

func (*Backend) GroupCompleted

func (b *Backend) GroupCompleted(groupUUID string, groupTaskCount int) (bool, error)

GroupCompleted returns true if all tasks in a group finished

func (*Backend) GroupTaskStates

func (b *Backend) GroupTaskStates(groupUUID string, groupTaskCount int) ([]*tasks.TaskState, error)

GroupTaskStates returns states of all tasks in the group

func (*Backend) InitGroup

func (b *Backend) InitGroup(groupUUID string, taskUUIDs []string) error

InitGroup creates and saves a group meta data object

func (*Backend) IsAMQP

func (b *Backend) IsAMQP() bool

func (*Backend) PurgeGroupMeta

func (b *Backend) PurgeGroupMeta(groupUUID string) error

PurgeGroupMeta deletes stored group meta data

func (*Backend) PurgeState

func (b *Backend) PurgeState(taskUUID string) error

PurgeState deletes stored task state

func (*Backend) SetStateFailure

func (b *Backend) SetStateFailure(signature *tasks.Signature, err string) error

SetStateFailure updates task state to FAILURE

func (*Backend) SetStatePending

func (b *Backend) SetStatePending(signature *tasks.Signature) error

SetStatePending updates task state to PENDING

func (*Backend) SetStateReceived

func (b *Backend) SetStateReceived(signature *tasks.Signature) error

SetStateReceived updates task state to RECEIVED

func (*Backend) SetStateRetry

func (b *Backend) SetStateRetry(signature *tasks.Signature) error

SetStateRetry updates task state to RETRY

func (*Backend) SetStateStarted

func (b *Backend) SetStateStarted(signature *tasks.Signature) error

SetStateStarted updates task state to STARTED

func (*Backend) SetStateSuccess

func (b *Backend) SetStateSuccess(signature *tasks.Signature, results []*tasks.TaskResult) error

SetStateSuccess updates task state to SUCCESS

func (*Backend) TriggerChord

func (b *Backend) TriggerChord(groupUUID string) (bool, error)

TriggerChord flags chord as triggered in the backend storage to make sure chord is never trigerred multiple times. Returns a boolean flag to indicate whether the worker should trigger chord (true) or no if it has been triggered already (false)

type Config

type Config struct {
	Broker        string `yaml:"broker"`
	DefaultQueue  string `yaml:"default_queue"`
	Exchange      string `yaml:"exchange"`
	ExchangeType  string `yaml:"exchange_type"`
	BindingKey    string `yaml:"binding_key"`
	PrefetchCount int    `yaml:"prefetch_count"`
}

wrap machinery config

func (Config) String

func (c Config) String() string

type DebugLogger

type DebugLogger struct{}

func (DebugLogger) Fatal

func (d DebugLogger) Fatal(args ...interface{})

func (DebugLogger) Fatalf

func (d DebugLogger) Fatalf(s string, args ...interface{})

func (DebugLogger) Fatalln

func (d DebugLogger) Fatalln(args ...interface{})

func (DebugLogger) Panic

func (d DebugLogger) Panic(args ...interface{})

func (DebugLogger) Panicf

func (d DebugLogger) Panicf(s string, args ...interface{})

func (DebugLogger) Panicln

func (d DebugLogger) Panicln(args ...interface{})

func (DebugLogger) Print

func (d DebugLogger) Print(args ...interface{})

func (DebugLogger) Printf

func (d DebugLogger) Printf(s string, args ...interface{})

func (DebugLogger) Println

func (d DebugLogger) Println(args ...interface{})

type ZLogger

type ZLogger struct{}

func (ZLogger) Fatal

func (l ZLogger) Fatal(args ...interface{})

func (ZLogger) Fatalf

func (l ZLogger) Fatalf(s string, args ...interface{})

func (ZLogger) Fatalln

func (l ZLogger) Fatalln(args ...interface{})

func (ZLogger) Panic

func (l ZLogger) Panic(args ...interface{})

func (ZLogger) Panicf

func (l ZLogger) Panicf(s string, args ...interface{})

func (ZLogger) Panicln

func (l ZLogger) Panicln(args ...interface{})

func (ZLogger) Print

func (l ZLogger) Print(args ...interface{})

func (ZLogger) Printf

func (l ZLogger) Printf(s string, args ...interface{})

we just need log about receiving message

func (ZLogger) Println

func (l ZLogger) Println(args ...interface{})

Jump to

Keyboard shortcuts

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