Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSourceBacklogStalled = errors.New("source backlog stalled")
ErrSourceBacklogStalled identifies a source worker that found eligible work but exhausted a bounded pass without successful durable advancement. A retryable failure may still move a candidate into deferred retry state; the worker treats repeated failure-only batches as stalled after its bound. The sentinel is intentionally independent of provider error text so the scheduled notification classifier can use the existing sources-stage type.
Functions ¶
This section is empty.
Types ¶
type SourceBacklogFunc ¶
type SourceBacklogFunc func(context.Context) (store.BacklogStats, error)
type SourceBacklogStalledError ¶ added in v0.8.21
type SourceBacklogStalledError struct {
Attempted int
Succeeded int
Errors int
SummaryRetriesDeferred int
FinalBacklog store.BacklogStats
}
func (*SourceBacklogStalledError) Error ¶ added in v0.8.21
func (e *SourceBacklogStalledError) Error() string
func (*SourceBacklogStalledError) Unwrap ¶ added in v0.8.21
func (e *SourceBacklogStalledError) Unwrap() error
type SourceOptions ¶
type SourceRunFunc ¶
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"`
SummaryRetriesDeferred int `json:"summary_retries_deferred"`
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)