worker

package
v0.8.18 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SourceBacklogFunc

type SourceBacklogFunc func(context.Context) (store.BacklogStats, error)

type SourceOptions

type SourceOptions struct {
	Watch         bool
	PollInterval  time.Duration
	IdleExitAfter time.Duration
	MaxCycles     int
	MaxSources    int
	Logger        *slog.Logger
	Now           func() time.Time
	Sleep         func(context.Context, time.Duration) error
}

type SourceRunFunc

type SourceRunFunc func(context.Context, int) (sourceenrich.Stats, error)

type SourceStats

type SourceStats struct {
	Cycles             int                `json:"cycles"`
	WorkCycles         int                `json:"work_cycles"`
	IdlePolls          int                `json:"idle_polls"`
	SourcesQueued      int                `json:"sources_queued"`
	SourcesExtracted   int                `json:"sources_extracted"`
	SourcesSummarized  int                `json:"sources_summarized"`
	SourcesRendered    int                `json:"sources_rendered"`
	SourcesUnchanged   int                `json:"sources_unchanged"`
	Errors             int                `json:"errors"`
	StoppedReason      string             `json:"stopped_reason"`
	FinalBacklog       store.BacklogStats `json:"final_backlog"`
	StartedAt          time.Time          `json:"started_at,omitempty"`
	CompletedAt        time.Time          `json:"completed_at,omitempty"`
	Duration           time.Duration      `json:"duration"`
	LastWorkCompleted  time.Time          `json:"last_work_completed,omitempty"`
	LastIdleObservedAt time.Time          `json:"last_idle_observed_at,omitempty"`
}

func RunSources

func RunSources(ctx context.Context, backlogFn SourceBacklogFunc, runFn SourceRunFunc, opts SourceOptions) (SourceStats, error)

Jump to

Keyboard shortcuts

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