domain

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	TaskID string
	// contains filtered or unexported fields
}

Task is a task to be executed

func NewFutureTask added in v1.2.0

func NewFutureTask(owner string, taskQueue string, payload string, timeout int32, maxRetries int32, notBefore int64) (*Task, error)

NewTask creates a new task

func NewTask

func NewTask(owner string, taskQueue string, payload string, timeout int32, maxRetries int32) *Task

NewTask creates a new task

func TaskFromStringMap

func TaskFromStringMap(data map[string]string) (*Task, error)

func (*Task) Cancel

func (t *Task) Cancel() error

Cancel mark a task as completed

func (*Task) Complete

func (t *Task) Complete(result string) error

Complete mark a task as completed

func (*Task) CreatedAt

func (t *Task) CreatedAt() int64

func (*Task) Fail

func (t *Task) Fail() error

Fail mark a task as failed

func (*Task) GetTimeout

func (t *Task) GetTimeout() int32

func (*Task) MaxRetries

func (t *Task) MaxRetries() int32

func (*Task) NotBefore added in v1.2.0

func (t *Task) NotBefore() int64

func (*Task) ObjectID

func (t *Task) ObjectID() string

ObjectID returns the ID of this task

func (*Task) Owner

func (t *Task) Owner() string

Owner returns the owner of this task

func (*Task) Payload

func (t *Task) Payload() string

Queue returns the queue name of this task

func (*Task) Queue

func (t *Task) Queue() string

Queue returns the queue name of this task

func (*Task) Result

func (t *Task) Result() (string, error)

Result returns the result of the task if it is completed and an error otherwise

func (*Task) Retries

func (t *Task) Retries() int32

Retries returns the number of retries that have been made

func (*Task) Select

func (t *Task) Select() error

Select mark a task as selected by a worker

func (*Task) State

func (t *Task) State() string

State returns the state of the task

func (*Task) Timeout

func (t *Task) Timeout() error

Timeout mark a task as timedout

func (*Task) UpdatedAt

func (t *Task) UpdatedAt() int64

Jump to

Keyboard shortcuts

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