jobcompleter

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncJobCompleter

type AsyncJobCompleter struct {
	baseservice.BaseService
	// contains filtered or unexported fields
}

func NewAsyncCompleter

func NewAsyncCompleter(archetype *baseservice.Archetype, adapter dbadapter.Adapter, concurrency uint32) *AsyncJobCompleter

func (*AsyncJobCompleter) JobSetCancelled

func (c *AsyncJobCompleter) JobSetCancelled(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time, errData []byte) error

func (*AsyncJobCompleter) JobSetCompleted

func (c *AsyncJobCompleter) JobSetCompleted(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time) error

func (*AsyncJobCompleter) JobSetDiscarded

func (c *AsyncJobCompleter) JobSetDiscarded(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time, errData []byte) error

func (*AsyncJobCompleter) JobSetErrored

func (c *AsyncJobCompleter) JobSetErrored(id int64, stats *jobstats.JobStatistics, scheduledAt time.Time, errData []byte) error

func (*AsyncJobCompleter) JobSetSnoozed

func (c *AsyncJobCompleter) JobSetSnoozed(id int64, stats *jobstats.JobStatistics, scheduledAt time.Time) error

func (*AsyncJobCompleter) Subscribe

func (c *AsyncJobCompleter) Subscribe(subscribeFunc func(update CompleterJobUpdated))

func (*AsyncJobCompleter) Wait

func (c *AsyncJobCompleter) Wait()

type CompleterJobUpdated

type CompleterJobUpdated struct {
	Job      *dbsqlc.RiverJob
	JobStats *jobstats.JobStatistics
}

type InlineJobCompleter

type InlineJobCompleter struct {
	baseservice.BaseService
	// contains filtered or unexported fields
}

func NewInlineCompleter

func NewInlineCompleter(archetype *baseservice.Archetype, adapter dbadapter.Adapter) *InlineJobCompleter

func (*InlineJobCompleter) JobSetCancelled

func (c *InlineJobCompleter) JobSetCancelled(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time, errData []byte) error

func (*InlineJobCompleter) JobSetCompleted

func (c *InlineJobCompleter) JobSetCompleted(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time) error

func (*InlineJobCompleter) JobSetDiscarded

func (c *InlineJobCompleter) JobSetDiscarded(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time, errData []byte) error

func (*InlineJobCompleter) JobSetErrored

func (c *InlineJobCompleter) JobSetErrored(id int64, stats *jobstats.JobStatistics, scheduledAt time.Time, errData []byte) error

func (*InlineJobCompleter) JobSetSnoozed

func (c *InlineJobCompleter) JobSetSnoozed(id int64, stats *jobstats.JobStatistics, scheduledAt time.Time) error

func (*InlineJobCompleter) Subscribe

func (c *InlineJobCompleter) Subscribe(subscribeFunc func(update CompleterJobUpdated))

func (*InlineJobCompleter) Wait

func (c *InlineJobCompleter) Wait()

type JobCompleter

type JobCompleter interface {
	// JobSetCancelled marks a job as cancelled.
	JobSetCancelled(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time, errData []byte) error

	// JobSetCompleted marks a job as completed.
	JobSetCompleted(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time) error

	// JobSetDiscarded marks a job as discarded.
	JobSetDiscarded(id int64, stats *jobstats.JobStatistics, finalizedAt time.Time, errData []byte) error

	// JobSetErrored marks a job as errored (but retryable).
	JobSetErrored(id int64, stats *jobstats.JobStatistics, scheduledAt time.Time, errData []byte) error

	// JobSetSnoozed reschedules a job for the future and increments its max attempts.
	JobSetSnoozed(id int64, stats *jobstats.JobStatistics, scheduledAt time.Time) error

	// Subscribe injects a callback which will be invoked whenever a job is
	// updated.
	Subscribe(subscribeFunc func(update CompleterJobUpdated))

	// Wait waits for all ongoing completions to finish, enabling graceful
	// shutdown.
	Wait()
}

Jump to

Keyboard shortcuts

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