When a feed is due, and which of its items are new. No IO, no clock: the
caller passes now in epoch seconds.
The scheduler does not sleep a whole period between polls. It ticks often
and asks due? of each feed against the time of that feed's last poll, which
is persisted. A restart, a suspended laptop or a slow poll therefore never
skips a day, and never polls a feed more often than the configured rate.
When a feed is due, and which of its items are new. No IO, no clock: the caller passes `now` in epoch seconds. The scheduler does not sleep a whole period between polls. It ticks often and asks `due?` of each feed against the time of that feed's last poll, which is persisted. A restart, a suspended laptop or a slow poll therefore never skips a day, and never polls a feed more often than the configured rate.
(due? now last-poll-at period)True when a feed last polled at last-poll-at (nil: never) should be polled
at now. A last poll in the future (clock moved back) counts as due, so a
wrong clock cannot silence a feed.
True when a feed last polled at `last-poll-at` (nil: never) should be polled at `now`. A last poll in the future (clock moved back) counts as due, so a wrong clock cannot silence a feed.
(feed-due? now {:keys [last-poll-at last-attempt-at]} period)True when a feed with feed-state should be polled at now: its last
successful poll is a period old, and no failed attempt is more recent than
the retry delay.
True when a feed with `feed-state` should be polled at `now`: its last successful poll is a period old, and no failed attempt is more recent than the retry delay.
(next-due-at now last-poll-at period)Epoch seconds at which the feed becomes due, or now when it already is.
Epoch seconds at which the feed becomes due, or `now` when it already is.
(period-seconds fetches-per-day)Seconds between two polls of one feed when it is polled fetches-per-day
times a day.
Seconds between two polls of one feed when it is polled `fetches-per-day` times a day.
(retry-seconds period)Seconds to wait after a failed poll before trying again: a tenth of the period, between five minutes and an hour. A feed that is down at its daily poll is retried the same day instead of waiting for the next one.
Seconds to wait after a failed poll before trying again: a tenth of the period, between five minutes and an hour. A feed that is down at its daily poll is retried the same day instead of waiting for the next one.
(select-new items seen max-items){:new items :seen seen'} for a poll of items against the seen keys.
:new holds at most max-items unseen items, newest first (undated items
after dated ones, in feed order). Only the keys of the items returned are
added to seen', so items past the cap arrive on a later poll rather than
being skipped.
`{:new items :seen seen'}` for a poll of `items` against the `seen` keys.
`:new` holds at most `max-items` unseen items, newest first (undated items
after dated ones, in feed order). Only the keys of the items returned are
added to `seen'`, so items past the cap arrive on a later poll rather than
being skipped.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |