pub struct NewsEngineConfig {
pub servers: Arc<Mutex<Vec<ServerConfig>>>,
pub article_timeout: Duration,
pub max_concurrent_fetches: usize,
pub work_channel_capacity: usize,
pub outcome_channel_capacity: usize,
pub probe_policy: Option<ServerProbePolicy>,
}Expand description
Configuration for NewsDispatchEngine. Mirrors the knobs exposed by
the old engine so the swap is drop-in from the caller’s perspective.
servers is held as an Arc<Mutex<_>> so the caller (queue manager) can
mutate it and DispatchEngine::reconcile_servers will pick up the new
list without requiring a new config instance or a full engine rebuild.
Fields§
§servers: Arc<Mutex<Vec<ServerConfig>>>§article_timeout: Duration§max_concurrent_fetches: usize§work_channel_capacity: usize§outcome_channel_capacity: usize§probe_policy: Option<ServerProbePolicy>Optional backup-server probe policy. Forwarded verbatim to
nzb_news::DownloaderConfig::probe_policy.
None disables probing (every cascade article tries every server).
Some(_) enables fast-fail on a backup server when the probed
hit-rate falls below the threshold for that job.
Defaults to Some(ServerProbePolicy::default()) which matches the
nzb-news default (probe 10 articles, require >=10% hits).
Implementations§
Source§impl NewsEngineConfig
impl NewsEngineConfig
Sourcepub fn new(servers: Vec<ServerConfig>, article_timeout: Duration) -> Self
pub fn new(servers: Vec<ServerConfig>, article_timeout: Duration) -> Self
Construct a config from an owned server list. Wraps the list in an
Arc<Mutex<_>> internally; if the caller already owns a shared Arc
(e.g. queue manager’s live server list), use
NewsEngineConfig::with_shared_servers instead so mutations are
visible to the engine.
Construct a config sharing an existing Arc<Mutex<Vec<ServerConfig>>>
with the caller. Mutating the Arc from outside and then calling
DispatchEngine::reconcile_servers rebuilds the downloader with
the latest server list — this is how live “add/remove server”
operations reach the fetch layer.
Trait Implementations§
Source§impl Clone for NewsEngineConfig
impl Clone for NewsEngineConfig
Source§fn clone(&self) -> NewsEngineConfig
fn clone(&self) -> NewsEngineConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for NewsEngineConfig
impl !RefUnwindSafe for NewsEngineConfig
impl Send for NewsEngineConfig
impl Sync for NewsEngineConfig
impl Unpin for NewsEngineConfig
impl UnsafeUnpin for NewsEngineConfig
impl !UnwindSafe for NewsEngineConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more