Versions in this module Expand all Collapse all v2 v2.0.15 Aug 4, 2024 Changes in this version + const StateFailure + const StatePending + const StateReceived + const StateRetry + const StateStarted + const StateSuccess + var ErrLastReturnValueMustBeError = errors.New("Last return value of a task must be error") + var ErrTaskMustBeFunc = errors.New("Task must be a func type") + var ErrTaskPanicked = errors.New("Invoking task caused a panic") + var ErrTaskReturnsNoValue = errors.New("Task must return at least a single value") + func HumanReadableResults(results []reflect.Value) string + func IsContextType(t reflect.Type) bool + func ReflectTaskResults(taskResults []*TaskResult) ([]reflect.Value, error) + func ReflectValue(valueType string, value interface{}) (reflect.Value, error) + func ValidateTask(task interface{}) error + type Arg struct + Name string + Type string + Value interface{} + type Chain struct + Tasks []*Signature + func NewChain(signatures ...*Signature) (*Chain, error) + type Chord struct + Callback *Signature + Group *Group + func NewChord(group *Group, callback *Signature) (*Chord, error) + type ErrRetryTaskLater struct + func NewErrRetryTaskLater(msg string, retryIn time.Duration) ErrRetryTaskLater + func (e ErrRetryTaskLater) Error() string + func (e ErrRetryTaskLater) RetryIn() time.Duration + type ErrUnsupportedType struct + func NewErrUnsupportedType(valueType string) ErrUnsupportedType + func (e ErrUnsupportedType) Error() string + type Group struct + GroupUUID string + Tasks []*Signature + func NewGroup(signatures ...*Signature) (*Group, error) + func NewGroupWithUUID(UUID string, signatures ...*Signature) (*Group, error) + func (group *Group) GetUUIDs() []string + type GroupMeta struct + ChordTriggered bool + CreatedAt time.Time + GroupUUID string + Lock bool + TTL int64 + TaskUUIDs []string + type Headers map[string]interface + func (h Headers) ForeachKey(handler func(key, val string) error) error + func (h Headers) Set(key, val string) + type Retriable interface + RetryIn func() time.Duration + type Signature struct + Args []Arg + BrokerMessageGroupId string + ChordCallback *Signature + ETA *time.Time + GroupTaskCount int + GroupUUID string + Headers Headers + IgnoreWhenTaskNotRegistered bool + Immutable bool + Name string + OnError []*Signature + OnSuccess []*Signature + Priority uint8 + RetryCount int + RetryTimeout int + RoutingKey string + SQSReceiptHandle string + StopTaskDeletionOnError bool + UUID string + func CopySignature(signature *Signature) *Signature + func CopySignatures(signatures ...*Signature) []*Signature + func NewSignature(name string, args []Arg) (*Signature, error) + func SignatureFromContext(ctx context.Context) *Signature + type Task struct + Args []reflect.Value + Context context.Context + TaskFunc reflect.Value + UseContext bool + func New(taskFunc interface{}, args []Arg) (*Task, error) + func NewWithSignature(taskFunc interface{}, signature *Signature) (*Task, error) + func (t *Task) Call() (taskResults []*TaskResult, err error) + func (t *Task) ReflectArgs(args []Arg) error + type TaskResult struct + Type string + Value interface{} + type TaskState struct + CreatedAt time.Time + Error string + GroupUUID string + Results []*TaskResult + State string + TTL int64 + TaskName string + TaskUUID string + func NewFailureTaskState(signature *Signature, err string) *TaskState + func NewPendingTaskState(signature *Signature) *TaskState + func NewReceivedTaskState(signature *Signature) *TaskState + func NewRetryTaskState(signature *Signature) *TaskState + func NewStartedTaskState(signature *Signature) *TaskState + func NewSuccessTaskState(signature *Signature, results []*TaskResult) *TaskState + func (taskState *TaskState) IsCompleted() bool + func (taskState *TaskState) IsFailure() bool + func (taskState *TaskState) IsSuccess() bool