asynq

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default_Task_PayloadType = Task_Protobuf
)

Default values for Task fields.

Variables

View Source
var (
	Task_PayloadType_name = map[int32]string{
		0: "Protobuf",
		1: "JSON",
	}
	Task_PayloadType_value = map[string]int32{
		"Protobuf": 0,
		"JSON":     1,
	}
)

Enum value maps for Task_PayloadType.

View Source
var (
	// optional asynq.Task task = 567890;
	E_Task = &file_asynq_asynq_proto_extTypes[0]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var File_asynq_asynq_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Task

type Task struct {

	// typename indicates the type of task to be performed.
	Typename *string `protobuf:"bytes,1,req,name=typename" json:"typename,omitempty"`
	// specify how long a task may run.
	// If the timeout elapses before the Handler returns, then the task
	// will be retried.
	//
	// Zero duration means no limit.
	//
	// If there's a conflicting Deadline option, whichever comes earliest
	// will be used.
	Timeout *int32 `protobuf:"varint,2,opt,name=timeout" json:"timeout,omitempty"`
	// specify the max number of times
	// the task will be retried.
	//
	// Negative retry count is treated as zero retry.
	MaxRetry *int32 `protobuf:"varint,3,opt,name=max_retry,json=maxRetry" json:"max_retry,omitempty"`
	// specify the duration of retention period for the task.
	// If this option is provided, the task will be stored as a completed task after successful processing.
	// A completed task will be deleted after the specified duration elapses.
	Retention *int32 `protobuf:"varint,4,opt,name=retention" json:"retention,omitempty"`
	// unique option to enqueue a task only if the given task is unique.
	// Task enqueued with this option is guaranteed to be unique within the given ttl.
	// Once the task gets processed successfully or once the TTL has expired, another task with the same uniqueness may be enqueued.
	// ErrDuplicateTask error is returned when enqueueing a duplicate task.
	// TTL duration must be greater than or equal to 1 second.
	//
	// Uniqueness of a task is based on the following properties:
	//     - Task Type
	//     - Task Payload
	//     - Queue Name
	Unique      *int32            `protobuf:"varint,5,opt,name=unique" json:"unique,omitempty"`
	PayloadType *Task_PayloadType `protobuf:"varint,6,opt,name=payload_type,json=payloadType,enum=asynq.Task_PayloadType,def=0" json:"payload_type,omitempty"`
	// contains filtered or unexported fields
}

func (*Task) Descriptor deprecated

func (*Task) Descriptor() ([]byte, []int)

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetMaxRetry added in v1.0.2

func (x *Task) GetMaxRetry() int32

func (*Task) GetPayloadType added in v1.0.4

func (x *Task) GetPayloadType() Task_PayloadType

func (*Task) GetRetention added in v1.0.2

func (x *Task) GetRetention() int32

func (*Task) GetTimeout added in v1.0.2

func (x *Task) GetTimeout() int32

func (*Task) GetTypename

func (x *Task) GetTypename() string

func (*Task) GetUnique added in v1.0.2

func (x *Task) GetUnique() int32

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

func (x *Task) ProtoReflect() protoreflect.Message

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type Task_PayloadType added in v1.0.4

type Task_PayloadType int32
const (
	Task_Protobuf Task_PayloadType = 0
	Task_JSON     Task_PayloadType = 1
)

func (Task_PayloadType) Descriptor added in v1.0.4

func (Task_PayloadType) Enum added in v1.0.4

func (Task_PayloadType) EnumDescriptor deprecated added in v1.0.4

func (Task_PayloadType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Task_PayloadType.Descriptor instead.

func (Task_PayloadType) Number added in v1.0.4

func (Task_PayloadType) String added in v1.0.4

func (x Task_PayloadType) String() string

func (Task_PayloadType) Type added in v1.0.4

func (*Task_PayloadType) UnmarshalJSON deprecated added in v1.0.4

func (x *Task_PayloadType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

Jump to

Keyboard shortcuts

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