jobs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 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 added in v0.2.0

type DescribableJob struct {
	Job
	Description string
}

type EventData added in v0.2.0

type EventData struct {
	Job Job
}

type Job

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

func WithDescription added in v0.2.0

func WithDescription(description string, job Job) Job

type JobFunc added in v0.2.0

type JobFunc func(ctx context.Context)

func (JobFunc) Execute added in v0.2.0

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