Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller polls vendor APIs for batch job status and cleans up expired results.
func NewPoller ¶
func NewPoller( db PollerDB, snapshots SnapshotProvider, throttle router.Throttle, tracker llm.UsageTracker, pollInterval, retentionPeriod time.Duration, ) *Poller
func (*Poller) CleanupOnce ¶
CleanupOnce executes one retention cleanup run.
type PollerDB ¶
type PollerDB interface {
LeaseUnfinishedBatches(ctx context.Context, leaseDuration time.Duration, limit int) ([]*proxydb.Batch, error)
UpdateBatchRunning(ctx context.Context, id string, total, done, failed int32) error
CompleteBatch(ctx context.Context, id string, finalState string, doneCount, failedCount int32, completedAt time.Time, items []*proxydb.BatchItem) error
ExpireBatch(ctx context.Context, id string, expiredAt time.Time) error
ListAllBatchItems(ctx context.Context, batchID string) ([]*proxydb.BatchItem, error)
DeleteBatchesOlderThan(ctx context.Context, cutoff time.Time) (int64, error)
}
PollerDB defines the DB operations needed by the poller.
type SnapshotProvider ¶
SnapshotProvider provides the current routing snapshot.