worker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// ID is the unique identifier of the job
	ID uuid.UUID `json:"id" validate:"required,uuid"`

	// Type is the type of the job. It should be the value of job.Type.String
	Type string `json:"type" validate:"required"`

	// Payload is the data to be passed to the job
	Payload string `json:"payload" validate:"-"`

	// RetryCount is the number of times the job has been retried
	RetryCount int `json:"retry_count" validate:"-"`

	// Caller is the information about the caller of the job
	Caller string `json:"caller" validate:"required"`

	// CreatedAt is the time the job was created
	CreatedAt time.Time `json:"created_at" validate:"required"`
}

func NewMessage

func NewMessage(ctx context.Context, t string, payload any) (Message, error)

NewMessage creates a new Message

func (*Message) Retry

func (m *Message) Retry()

Retry increments the RetryCount of the job

func (*Message) SetCaller

func (m *Message) SetCaller(caller string)

SetCaller sets the Caller of the job

Jump to

Keyboard shortcuts

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