domain

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Process(context.Context, Job) error
}

type Job

type Job struct {
	event.Emitter
	// contains filtered or unexported fields
}

func JobFrom

func JobFrom(scanner storage.Scanner) (j Job, err error)

Recreates a job from a storage scanner

func NewJob

func NewJob(name, payload string) (j Job)

Creates a new job which will be processed by a worker later on.

func (*Job) Done

func (j *Job) Done()

Mark a job as done.

func (*Job) Failed

func (j *Job) Failed(err error)

Mark the job has failed. It will be retried later on.

func (Job) ID

func (j Job) ID() JobID

func (Job) Name

func (j Job) Name() string

func (Job) Payload

func (j Job) Payload() string

type JobDone

type JobDone struct {
	ID JobID
}

type JobFailed

type JobFailed struct {
	ID      JobID
	ErrCode string
	RetryAt time.Time
}

type JobID

type JobID string

type JobQueued

type JobQueued struct {
	ID       JobID
	Name     string
	Payload  string
	QueuedAt time.Time
}

type JobsReader

type JobsReader interface {
	GetNextPendingJob(context.Context) (Job, error)
}

type JobsWriter

type JobsWriter interface {
	Write(context.Context, ...*Job) error
}

Jump to

Keyboard shortcuts

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