module

Delivery::Dispatch

Delivery::Dispatch — fans episodes out to subscribers per their delivery_mode.

eligible_targets is the pure heart of the module: given subscriber and episode projections, it computes which (subscriber, episode) combinations should actually receive a Telegram delivery. Backfill protection lives here: only episodes published AFTER the user subscribed are delivered.

fanout (added in the next task) wires this to the real models + side effects (spawn per target, call Notify or AudioSender by mode).

Class methods

eligible_targets(subscribers : Array(Subscriber), episodes : Array(EpisodeRef)) : Array(Target)
Source
fanout(feed : Feed, episodes : Array(Episode))

Fanout entry called from FeedRefresher after a refresh batch. Builds subscriber + episode projections, runs the eligibility filter, and spawns one fiber per target — same fire-and-forget pattern used for /episodes/:id/send.

Source

Nested types