pub struct TaskConfig {
pub task_type: i16,
pub priority: TaskPriority,
pub topic: String,
pub timeout_seconds: u64,
pub max_retries: u32,
pub retry_strategy: RetryStrategy,
pub retry_delay_seconds: u64,
pub max_retry_delay_seconds: u64,
pub description: &'static str,
pub dead_letter_topic: Option<String>,
}Expand description
任务配置 —— 每种 task_type 对应一份配置
Fields§
§task_type: i16任务类型标识
priority: TaskPriority任务优先级
topic: StringKafka topic 名称
timeout_seconds: u64任务执行超时时间(秒)
max_retries: u32最大重试次数
retry_strategy: RetryStrategy重试策略
retry_delay_seconds: u64重试延迟基础时间(秒)
max_retry_delay_seconds: u64最大重试延迟时间(秒)
description: &'static str任务描述
dead_letter_topic: Option<String>死信队列 topic —— 超过 max_retries 后转发到此 topic(None 则不启用)
Trait Implementations§
Source§impl Clone for TaskConfig
impl Clone for TaskConfig
Source§fn clone(&self) -> TaskConfig
fn clone(&self) -> TaskConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskConfig
impl RefUnwindSafe for TaskConfig
impl Send for TaskConfig
impl Sync for TaskConfig
impl Unpin for TaskConfig
impl UnsafeUnpin for TaskConfig
impl UnwindSafe for TaskConfig
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