nzb_dispatch/lib.rs
1//! nzb-dispatch — article-level download dispatcher for the nzb-* engine.
2//!
3//! Responsibilities:
4//! - Per-server worker pool (spawn/retire workers as server config changes)
5//! - Priority-aware article-fetch scheduling with retry across servers
6//! - Connection tracking, circuit breaker, byte-level heartbeat
7//! - Job context lifecycle (register on submit, drain on completion)
8//! - Hopeless-job detection hooks exposed via progress events
9//!
10//! Boundary: the [`dispatch_engine::DispatchEngine`] trait is the contract
11//! consumed by the job queue / orchestrator layer. Progress is reported
12//! back via a `mpsc::Sender<dispatch_engine::ProgressUpdate>` channel per job.
13//!
14//! This crate does NOT own job persistence, post-processing, or the public
15//! HTTP API. Those live in `nzb-queue`, `nzb-postproc`, and `nzb-engine`.
16
17pub mod article_failure;
18pub mod bandwidth;
19pub mod dispatch_engine;
20pub mod download_engine;
21pub mod util;
22
23// Convenience re-exports — the types downstream crates reach for.
24pub use article_failure::{ArticleFailure, ArticleFailureKind};
25pub use bandwidth::{BandwidthConfig, BandwidthLimiter};
26pub use dispatch_engine::{DispatchEngine, DispatchHandle};
27pub use download_engine::{
28 ConnectionSlot, ConnectionTracker, ProgressUpdate, ServerHealth, SlotStatus, WorkerPool,
29 has_known_extension,
30};