Skip to main content

DispatcherConfig

Struct DispatcherConfig 

Source
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: u64

worker 开始投递后覆盖全部尝试与退避的总预算,单位毫秒,不含排队时间。

§shutdown_drain_timeout_ms: u64

停机后队列排空预算,单位毫秒,同时受宿主剩余期限约束。

§max_attempts: usize

同一通知最多尝试次数,包含首次投递;重试还须有安全证据。

§retry_initial_backoff_ms: u64

可安全重试时的初始退避,单位毫秒。

§retry_max_backoff_ms: u64

指数退避的上限,单位毫秒;服务端要求的最小等待仍须满足。

Implementations§

Source§

impl DispatcherConfig

Source

pub fn validate(&self) -> Result<(), ConfigError>

业务作用:在分配队列或调用渠道前验证调度资源和时间上限。

参数说明:无。

返回:配置合法时成功,否则只返回静态字段名。

Trait Implementations§

Source§

impl Clone for DispatcherConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DispatcherConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DispatcherConfig

Source§

fn default() -> Self

业务作用:提供所有宿主共用的有限队列与投递预算。

参数说明:无。

返回:关闭无限等待和无限重试的稳定默认值。

Source§

impl<'de> Deserialize<'de> for DispatcherConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for DispatcherConfig

Source§

impl PartialEq for DispatcherConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DispatcherConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DispatcherConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.