Documentation
¶
Overview ¶
Package polling is the worker's side of the poll stage. The scheduler queues a poll task each time a poll connector falls due, and a worker that holds the source's poller claims it. The poller reads the source past the connector's cursor and answers what it found, which serve lands in the write that ends the lease. A source names its poller in its one registration with the sources package, which opens it for a worker from the source's [source.<name>] table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Outcome ¶
type Outcome struct {
// Arrivals are what the poll found, in the order they land. Cursor is the
// connector's next position, and nil keeps the one it has.
Arrivals []server.ReportArrival
Cursor *string
// Error is why the poll read nothing, and nil where it ended done.
Error *string
// RetryAfter is how long the source asked the same poll to wait before it
// tries again, such as until its day's quota resets. Zero fails the poll,
// and the connector's backoff makes it due again.
RetryAfter time.Duration
// Counts are what the poll passed over, by reason, such as unavailable
// videos. The handler logs them beside the task.
Counts map[string]int
// Warnings are what a person should know about a poll that ended done,
// such as a read that stopped short of where the last one ended. The
// handler logs each as a warning.
Warnings []string
}
Outcome is how one poll ended.
type Poll ¶
type Poll struct {
Connector connectors.Connector
Cursor *string
}
Poll is one poll a poller runs: its connector as the set in force declares it, and the position an earlier poll left, nil before the first.