Skip to content

l0.DependencyControl.FeedLoader

FeedLoader = require "l0.DependencyControl.FeedLoader"
local FeedLoader = require("l0.DependencyControl.FeedLoader")

FeedLoader

Owns DependencyControl's single on-disk feed cache and hands out UpdateFeed instances wired to it, so no consumer assembles feed-fetch settings or names the cache. One instance is built per config (the updater keeps the shared one) and injected into every feed consumer; its cache is reachable as .cache.

Constructor

feedLoader = FeedLoader config, logger
local feedLoader = FeedLoader(config, logger)

Reads the feed-fetch settings once and opens the shared feed cache under DepCtrl's namespace, wiring its L1 layer to UpdateFeed's decoder so a cache hit serves a ready-parsed feed base.

param type description
config ConfigView The global config view; reads paths.cache, feeds.cacheMaxAge/feeds.maxFeedSize/feeds.feedFetchTimeout and updates.blockPrivateHosts.
logger? Logger Logger for the cache and the feeds it loads.

Instance methods

load

feedLoader\load url, opts
feedLoader:load(url, opts)

Builds an UpdateFeed for the given URL, injecting the shared cache and the configured fetch policy.

param type description
url string The feed URL to load.
opts? { autoLoad?: boolean } autoLoad fetches immediately (default true). To refresh an entire update pass, expire the cache with FileCache.expireAll.

Returns:

Fields

field type description
cache FileCache The shared feed cache, for metadata reads such as a feed's last-fetch time.
defaultMaxFeedSize number
defaultFeedFetchTimeout integer