Documentation ¶
Index ¶
- func New(cnf *config.Config, host, password, socketPath string, db int) iface.Backend
- func NewGR(cnf *config.Config, addrs []string, db int) 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 BackendGR
- func (b *BackendGR) GetState(taskUUID string) (*tasks.TaskState, error)
- func (b *BackendGR) GroupCompleted(groupUUID string, groupTaskCount int) (bool, error)
- func (b *BackendGR) GroupTaskStates(groupUUID string, groupTaskCount int) ([]*tasks.TaskState, error)
- func (b *BackendGR) InitGroup(groupUUID string, taskUUIDs []string) error
- func (b *BackendGR) PurgeGroupMeta(groupUUID string) error
- func (b *BackendGR) PurgeState(taskUUID string) error
- func (b *BackendGR) SetStateFailure(signature *tasks.Signature, err string) error
- func (b *BackendGR) SetStatePending(signature *tasks.Signature) error
- func (b *BackendGR) SetStateReceived(signature *tasks.Signature) error
- func (b *BackendGR) SetStateRetry(signature *tasks.Signature) error
- func (b *BackendGR) SetStateStarted(signature *tasks.Signature) error
- func (b *BackendGR) SetStateSuccess(signature *tasks.Signature, results []*tasks.TaskResult) error
- func (b *BackendGR) TriggerChord(groupUUID string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct { common.Backend common.RedisConnector // contains filtered or unexported fields }
Backend represents a Redis result backend
func (*Backend) GroupCompleted ¶
GroupCompleted returns true if all tasks in a group finished
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 BackendGR ¶ added in v1.10.8
BackendGR represents a Redis result backend
func (*BackendGR) GroupCompleted ¶ added in v1.10.8
GroupCompleted returns true if all tasks in a group finished
func (*BackendGR) GroupTaskStates ¶ added in v1.10.8
func (b *BackendGR) GroupTaskStates(groupUUID string, groupTaskCount int) ([]*tasks.TaskState, error)
GroupTaskStates returns states of all tasks in the group
func (*BackendGR) PurgeGroupMeta ¶ added in v1.10.8
PurgeGroupMeta deletes stored group meta data
func (*BackendGR) PurgeState ¶ added in v1.10.8
PurgeState deletes stored task state
func (*BackendGR) SetStateFailure ¶ added in v1.10.8
SetStateFailure updates task state to FAILURE
func (*BackendGR) SetStatePending ¶ added in v1.10.8
SetStatePending updates task state to PENDING
func (*BackendGR) SetStateReceived ¶ added in v1.10.8
SetStateReceived updates task state to RECEIVED
func (*BackendGR) SetStateRetry ¶ added in v1.10.8
SetStateRetry updates task state to RETRY
func (*BackendGR) SetStateStarted ¶ added in v1.10.8
SetStateStarted updates task state to STARTED
func (*BackendGR) SetStateSuccess ¶ added in v1.10.8
SetStateSuccess updates task state to SUCCESS
func (*BackendGR) TriggerChord ¶ added in v1.10.8
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)