jobs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobStartEvent  = "jobs.start"
	JobIdleEvent   = "jobs.idle"
	JobUpdateEvent = "jobs.update"
)

Variables

This section is empty.

Functions

func PostUpdate

func PostUpdate(ctx context.Context, msg string)

Types

type DescribableJob

type DescribableJob struct {
	Job
	Description string
}

type EventData

type EventData struct {
	Job Job
}

type Job

type Job interface {
	Execute(ctx context.Context)
}

func WithDescription

func WithDescription(description string, job Job) Job

type JobFunc

type JobFunc func(ctx context.Context)

func (JobFunc) Execute

func (jf JobFunc) Execute(ctx context.Context)

type Services

type Services struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(bus *bus.Bus) *Services

func (*Services) CancelForegroundJob

func (jc *Services) CancelForegroundJob() bool

func (*Services) SubmitForegroundJob

func (jc *Services) SubmitForegroundJob(job Job) error

SubmitForegroundJob starts a foreground job.

Jump to

Keyboard shortcuts

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