worker_models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWorkerConfig

type FileWorkerConfig struct {
	Path              string
	MaxRetry          int
	CheckInterval     int
	TaskSleepDuration float64
	Concurrency       int
	Priorities        map[string]int
	Timezone          string
}

type RedisWorkerConfig

type RedisWorkerConfig struct {
	Host        string
	Port        string
	Username    string
	Password    string
	Database    int
	MaxRetry    int
	Concurrency int
	Priorities  map[string]int
}

type TaskMessage

type TaskMessage struct {
	ID        string
	TypeName  string
	FileName  string
	Queue     string
	Payload   []byte
	Retried   int
	CreatedAt time.Time
	UpdatedAt *time.Time
}

func NewQueue

func NewQueue(typeName string) TaskMessage

func (*TaskMessage) SetPayload

func (q *TaskMessage) SetPayload(payload []byte)

func (*TaskMessage) SetQueue

func (q *TaskMessage) SetQueue(queue string)

Jump to

Keyboard shortcuts

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