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 news_engine;
22pub mod util;
23
24pub use news_engine::{NewsDispatchEngine, NewsEngineConfig};
25
26// Re-export the underlying probe-policy type so downstream crates (nzb-web,
27// Arz, ...) can configure it without depending on nzb-news directly.
28pub use nzb_news::ServerProbePolicy;
29
30// Convenience re-exports — the types downstream crates reach for.
31pub use article_failure::{ArticleFailure, ArticleFailureKind};
32pub use bandwidth::{BandwidthConfig, BandwidthLimiter};
33pub use dispatch_engine::{DispatchEngine, DispatchHandle};
34pub use download_engine::{
35 ConnectionSlot, ConnectionTracker, ProgressUpdate, ServerHealth, SlotStatus, WorkerPool,
36};