Skip to main content

Module dispatch_engine

Module dispatch_engine 

Source
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§

DispatchHandle
Dynamic-dispatch wrapper around Arc<WorkerPool> — the one concrete DispatchEngine impl today. Extract this into nzb-dispatch in Phase B.
ServerAttemptStats
Per-server lifetime counters reported via DispatchEngine::server_stats_snapshot. not_found is the strongest signal for a dead NZB; transient_failed separates “missing articles” from “server flaky / auth issues”.

Traits§

DispatchEngine
Article-dispatch engine: accepts jobs, drives NNTP fetches, emits progress.