pub struct DispatcherConfig {
pub queue_capacity: usize,
pub max_in_flight: usize,
pub delivery_timeout_ms: u64,
pub shutdown_drain_timeout_ms: u64,
pub max_attempts: usize,
pub retry_initial_backoff_ms: u64,
pub retry_max_backoff_ms: u64,
}Expand description
进程级通知调度预算;未启用通知时仅保留配置,不创建运行资源。
Fields§
§queue_capacity: usize等待 worker 接收的通知数量上限。
max_in_flight: usize宿主同时执行的通知投递数量上限。
delivery_timeout_ms: u64worker 开始投递后覆盖全部尝试与退避的总预算,单位毫秒,不含排队时间。
shutdown_drain_timeout_ms: u64停机后队列排空预算,单位毫秒,同时受宿主剩余期限约束。
max_attempts: usize同一通知最多尝试次数,包含首次投递;重试还须有安全证据。
retry_initial_backoff_ms: u64可安全重试时的初始退避,单位毫秒。
retry_max_backoff_ms: u64指数退避的上限,单位毫秒;服务端要求的最小等待仍须满足。
Implementations§
Source§impl DispatcherConfig
impl DispatcherConfig
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
业务作用:在分配队列或调用渠道前验证调度资源和时间上限。
参数说明:无。
返回:配置合法时成功,否则只返回静态字段名。
Trait Implementations§
Source§impl Clone for DispatcherConfig
impl Clone for DispatcherConfig
Source§impl Debug for DispatcherConfig
impl Debug for DispatcherConfig
Source§impl Default for DispatcherConfig
impl Default for DispatcherConfig
Source§impl<'de> Deserialize<'de> for DispatcherConfigwhere
DispatcherConfig: Default,
impl<'de> Deserialize<'de> for DispatcherConfigwhere
DispatcherConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DispatcherConfig
Source§impl PartialEq for DispatcherConfig
impl PartialEq for DispatcherConfig
Source§impl Serialize for DispatcherConfig
impl Serialize for DispatcherConfig
impl StructuralPartialEq for DispatcherConfig
Auto Trait Implementations§
impl Forget for DispatcherConfig
impl Freeze for DispatcherConfig
impl Move for DispatcherConfig
impl RefUnwindSafe for DispatcherConfig
impl Send for DispatcherConfig
impl Sync for DispatcherConfig
impl Unpin for DispatcherConfig
impl UnsafeUnpin for DispatcherConfig
impl UnwindSafe for DispatcherConfig
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
Mutably borrows from an owned value. Read more