supervisor

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Tracker           Tracker
	Owner             string
	LeaseDuration     time.Duration
	HeartbeatInterval time.Duration
}

type ResultRunner

type ResultRunner interface {
	Runner
	RunResult(ctx context.Context) (json.RawMessage, error)
}

type ResultRunnerFunc

type ResultRunnerFunc func(ctx context.Context) (json.RawMessage, error)

func (ResultRunnerFunc) Run

func (fn ResultRunnerFunc) Run(ctx context.Context) error

func (ResultRunnerFunc) RunResult

func (fn ResultRunnerFunc) RunResult(ctx context.Context) (json.RawMessage, error)

type Runner

type Runner interface {
	Run(ctx context.Context) error
}

type RunnerFunc

type RunnerFunc func(ctx context.Context) error

func (RunnerFunc) Run

func (fn RunnerFunc) Run(ctx context.Context) error

type Stage

type Stage struct {
	Name        StageName
	Interval    time.Duration
	Enabled     bool
	BatchSize   int
	Concurrency int
	Backoff     time.Duration
	Runner      Runner
}

type StageName

type StageName string
const (
	StageScrapeLatest     StageName = "scrape_latest"
	StageScrapeBackfill   StageName = "scrape_backfill"
	StageAssemble         StageName = "assemble"
	StageAssembleLaneA    StageName = "assemble_lane_a"
	StageAssembleLaneB    StageName = "assemble_lane_b"
	StageRecoverYEnc      StageName = "recover_yenc"
	StageRelease          StageName = "release"
	StageInspectDiscovery StageName = "inspect_discovery"
	StageInspectPAR2      StageName = "inspect_par2"
	StageInspectNFO       StageName = "inspect_nfo"
	StageInspectArchive   StageName = "inspect_archive"
	StageInspectPassword  StageName = "inspect_password"
	StageInspectMedia     StageName = "inspect_media"
	StageEnrichPreDB      StageName = "enrich_predb"
	StageEnrichTMDB       StageName = "enrich_tmdb"
	StageMaintenance      StageName = "indexer_maintenance"
)

type Supervisor

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

func New

func New(log logger, stages []Stage, options ...Options) *Supervisor

func (*Supervisor) Run

func (s *Supervisor) Run(ctx context.Context) error

func (*Supervisor) RunSelected

func (s *Supervisor) RunSelected(ctx context.Context, names ...StageName) error

func (*Supervisor) RunStageOnce

func (s *Supervisor) RunStageOnce(ctx context.Context, name StageName) error

func (*Supervisor) RunStagesOnce

func (s *Supervisor) RunStagesOnce(ctx context.Context, names ...StageName) error

type Tracker

type Tracker interface {
	ClaimIndexerStage(ctx context.Context, req pgindex.IndexerStageClaimRequest) (*pgindex.IndexerStageClaimResult, error)
	HeartbeatIndexerStageRun(ctx context.Context, runID int64, owner string, leaseDuration time.Duration) error
	CompleteIndexerStageRun(ctx context.Context, req pgindex.IndexerStageFinishRequest) error
	FailIndexerStageRun(ctx context.Context, req pgindex.IndexerStageFinishRequest) error
}

Jump to

Keyboard shortcuts

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