Expand description
DispatchEngine trait — boundary between the job queue and the article dispatcher.
This is the contract the queue layer depends on; it hides the concrete
WorkerPool implementation. The reverse direction (dispatcher → queue) is
already a decoupled channel (mpsc::Sender<ProgressUpdate>), so only this
one trait is needed to cleanly separate the two layers.
A DispatchEngine is responsible for turning an NzbJob into article
fetches against the configured NNTP servers and reporting progress via
the per-job ProgressUpdate channel. It must be able to pause, resume,
cancel, and abort individual jobs, reconcile its worker set with the
server list, and shut down gracefully.
Structs§
- Dispatch
Handle - Dynamic-dispatch wrapper around
Arc<WorkerPool>— the one concreteDispatchEngineimpl today. Extract this intonzb-dispatchin Phase B. - Server
Attempt Stats - Per-server lifetime counters reported via
DispatchEngine::server_stats_snapshot.not_foundis the strongest signal for a dead NZB;transient_failedseparates “missing articles” from “server flaky / auth issues”.
Traits§
- Dispatch
Engine - Article-dispatch engine: accepts jobs, drives NNTP fetches, emits progress.