Documentation
¶
Overview ¶
Package poller runs each view's GitHub query on an interval.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
func New ¶
func New(s Searcher, views []config.View, interval time.Duration, limitFor func(config.View) int) *Poller
New returns a poller for views. limitFor gives each view's PR limit; nil uses config.DefaultMaxPRs for every view.
func (*Poller) PollNow ¶
func (p *Poller) PollNow()
PollNow asks Run to start a new round immediately. It never blocks.
func (*Poller) Run ¶
Run polls every view once, then again after each interval (backed off while every view fails) or when PollNow is called, until ctx is cancelled. Views that fail transiently (GitHub 5xx, network) while others succeed are re-polled on their own after retryBase, doubling each time, until they recover or the next full round is due.
type Result ¶
type Result struct {
View string
Query string // the query that produced this result
PRs []github.PR
Err error
At time.Time
// Truncated reports that GitHub has more matches than the view's limit.
Truncated bool
}
Result is one view's poll outcome. Err with nil PRs is a failed poll and the caller keeps whatever it showed before; Err with PRs is a warning.