dispatchservice

package
v0.0.0-...-35541fa Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dbInstance libdb.DBManager, config *serverops.Config) *service

Types

type JobInfo

type JobInfo struct {
	ID           string    `json:"id"`
	TaskType     string    `json:"taskType"`
	ScheduledFor time.Time `json:"scheduledFor"`
	ValidUntil   time.Time `json:"validUntil"`
	CreatedAt    time.Time `json:"createdAt"`
}

type Service

type Service interface {
	PendingJobs(ctx context.Context, createdAtCursor *time.Time) ([]*store.Job, error)
	InProgressJobs(ctx context.Context, createdAtCursor *time.Time) ([]*store.LeasedJob, error)

	AssignPendingJob(ctx context.Context, leaserID string, leaseDuration *time.Duration, jobTypes ...string) (*store.LeasedJob, error)
	MarkJobAsDone(ctx context.Context, jobID string, leaserID string) error
	MarkJobAsFailed(ctx context.Context, jobID string, leaserID string) error

	serverops.ServiceMeta
}

func NewService

func NewService(dbInstance libdb.DBManager) Service

Jump to

Keyboard shortcuts

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