queuescanner

package
v0.136.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package queuescanner drives the queue-scan loop: listing queued prompts, validating them, handling blockers, and dispatching to a PromptProcessor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromptManager

type PromptManager interface {
	ListQueued(ctx context.Context) ([]prompt.Prompt, error)
	Load(ctx context.Context, path string) (*prompt.PromptFile, error)
	AllPreviousCompleted(ctx context.Context, n int) bool
	FindMissingCompleted(ctx context.Context, n int) []int
	FindPromptStatusInProgress(ctx context.Context, number int) string
	SetStatus(ctx context.Context, path string, status string) error
}

PromptManager is the minimal subset this package needs. Defined locally to avoid an import cycle (pkg/processor imports queuescanner).

type PromptProcessor

type PromptProcessor interface {
	ProcessPrompt(ctx context.Context, pr prompt.Prompt) error
}

PromptProcessor executes a single prompt end-to-end. Implemented by *processor (avoids a cycle: scanner depends on processor's per-prompt entrypoint).

type Scanner

type Scanner interface {
	// ScanAndProcess returns the count of prompts that completed during this scan.
	// The count feeds into the post-#337 NothingToDoCallback (no-progress detection in one-shot mode).
	ScanAndProcess(ctx context.Context) (completed int, err error)
	// HasPendingVerification returns true if any prompt in the queue dir has pending_verification status.
	HasPendingVerification(ctx context.Context) bool
	// ClearSkippedCache clears the skip cache so all files are re-evaluated on the next scan.
	// Called by the processor on fsnotify wakeup events.
	ClearSkippedCache()
}

Scanner drives the queue-scan loop: list queued, validate, dispatch to PromptProcessor, handle blockers.

func NewScanner

func NewScanner(
	promptManager PromptManager,
	promptProcessor PromptProcessor,
	failureHandler failurehandler.Handler,
	queueDir string,
) Scanner

NewScanner creates a new Scanner.

Jump to

Keyboard shortcuts

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