Documentation ¶
Index ¶
- func New(cnf *config.Config) iface.Backend
- type Backend
- func (b *Backend) GetState(taskUUID string) (*tasks.TaskState, error)
- func (b *Backend) GroupCompleted(groupUUID string, groupTaskCount int) (bool, error)
- func (b *Backend) GroupTaskStates(groupUUID string, groupTaskCount int) ([]*tasks.TaskState, error)
- func (b *Backend) InitGroup(groupUUID string, taskUUIDs []string) error
- func (b *Backend) PurgeGroupMeta(groupUUID string) error
- func (b *Backend) PurgeState(taskUUID string) error
- func (b *Backend) SetStateFailure(signature *tasks.Signature, err string) error
- func (b *Backend) SetStatePending(signature *tasks.Signature) error
- func (b *Backend) SetStateReceived(signature *tasks.Signature) error
- func (b *Backend) SetStateRetry(signature *tasks.Signature) error
- func (b *Backend) SetStateStarted(signature *tasks.Signature) error
- func (b *Backend) SetStateSuccess(signature *tasks.Signature, results []*tasks.TaskResult) error
- func (b *Backend) TriggerChord(groupUUID string) (bool, error)
- type ResultMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct { common.Backend common.AMQPConnector }
Backend represents an AMQP result backend
func (*Backend) GetState ¶
GetState returns the latest task state. It will only return the status once as the message will get consumed and removed from the queue.
func (*Backend) GroupCompleted ¶
GroupCompleted returns true if all tasks in a group finished NOTE: Given AMQP limitation this will only return true if all finished tasks were successful as we do not keep track of completed failed tasks
func (*Backend) GroupTaskStates ¶
GroupTaskStates returns states of all tasks in the group
func (*Backend) PurgeGroupMeta ¶
PurgeGroupMeta deletes stored group meta data
func (*Backend) PurgeState ¶
PurgeState deletes stored task state
func (*Backend) SetStateFailure ¶
SetStateFailure updates task state to FAILURE
func (*Backend) SetStatePending ¶
SetStatePending updates task state to PENDING
func (*Backend) SetStateReceived ¶
SetStateReceived updates task state to RECEIVED
func (*Backend) SetStateRetry ¶
SetStateRetry updates task state to RETRY
func (*Backend) SetStateStarted ¶
SetStateStarted updates task state to STARTED
func (*Backend) SetStateSuccess ¶
SetStateSuccess updates task state to SUCCESS
func (*Backend) TriggerChord ¶
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 ResultMessage ¶ added in v1.7.0
type ResultMessage struct { ID string `json:"task_id"` Status string `json:"status"` Traceback interface{} `json:"traceback"` Result interface{} `json:"result"` Children []interface{} `json:"children"` }
Celery requires specific format