IAddon hive.rss. Construction is pure. initialize! validates the config,
loads feed state, registers the rss ingestion source and starts the
scheduler; shutdown! undoes all three.
The scheduler is the addon's own: one daemon thread that wakes every
tick seconds (a quarter hour, or the period when that is shorter) and
polls the feeds that are due. Due-ness is read from the persisted time of
each feed's last poll, so feeds are polled :rss/fetches-per-day times a
day across restarts, never more, and a restart never skips a day.
Config (manifest :addon/config, then config.edn :addons {"hive.rss" {..}}):
:rss/feeds ["https://.." {:feed/url .. :feed/id .. :feed/tags [..]}]
:rss/fetches-per-day 1..96 (default 1)
:rss/project-id memory scope items are filed under (default "hive-rss")
:rss/memory-type entry type (default "note")
:rss/duration entry duration (default "medium")
:rss/sink "auto" | "memory" | "ingestor" (default "auto": through
hive-ingestor when the host offers :tools/invoke)
:rss/max-items-per-poll, :rss/timeout-ms, :rss/max-bytes,
:rss/initial-delay-ms, :rss/state-file
IAddon `hive.rss`. Construction is pure. `initialize!` validates the config,
loads feed state, registers the `rss` ingestion source and starts the
scheduler; `shutdown!` undoes all three.
The scheduler is the addon's own: one daemon thread that wakes every
`tick` seconds (a quarter hour, or the period when that is shorter) and
polls the feeds that are due. Due-ness is read from the persisted time of
each feed's last poll, so feeds are polled `:rss/fetches-per-day` times a
day across restarts, never more, and a restart never skips a day.
Config (manifest `:addon/config`, then config.edn `:addons {"hive.rss" {..}}`):
:rss/feeds ["https://.." {:feed/url .. :feed/id .. :feed/tags [..]}]
:rss/fetches-per-day 1..96 (default 1)
:rss/project-id memory scope items are filed under (default "hive-rss")
:rss/memory-type entry type (default "note")
:rss/duration entry duration (default "medium")
:rss/sink "auto" | "memory" | "ingestor" (default "auto": through
hive-ingestor when the host offers :tools/invoke)
:rss/max-items-per-poll, :rss/timeout-ms, :rss/max-bytes,
:rss/initial-delay-ms, :rss/state-file(addon-ctor config)hive-addon.mount constructor: config -> uninitialized IAddon.
hive-addon.mount constructor: config -> uninitialized IAddon.
(make-addon)(make-addon seed)Uninitialized IAddon. No thread, file or registry is touched.
Uninitialized IAddon. No thread, file or registry is touched.
(poll! a)(poll! {:keys [state]} opts)Run one pass over the feeds now, on the calling thread. opts:
:force? polls feeds that are not due, :feed-id narrows to one feed.
Returns the pass's reports, or {:skipped :busy} when a pass is running.
Run one pass over the feeds now, on the calling thread. `opts`:
`:force?` polls feeds that are not due, `:feed-id` narrows to one feed.
Returns the pass's reports, or `{:skipped :busy}` when a pass is running.(status {:keys [state]})What the addon knows: settings summary, each feed's state and next poll. A feed with credentials shows its scheme, never the secret.
What the addon knows: settings summary, each feed's state and next poll. A feed with credentials shows its scheme, never the secret.
(tick-seconds fetches-per-day)How often the scheduler wakes to look for due feeds.
How often the scheduler wakes to look for due feeds.
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 |