pub struct RuntimeConfig {
pub shutdown_timeout: Duration,
pub task_startup: TaskStartupConfig,
pub health_check: HealthCheckConfig,
pub metrics: MetricsConfig,
pub default_poll_worker: PollWorkerConfig,
}Expand description
微服务运行时配置
Fields§
§shutdown_timeout: Duration关闭超时时间(默认 5 秒)
task_startup: TaskStartupConfig任务启动配置
health_check: HealthCheckConfig健康检查配置
metrics: MetricsConfig指标配置
default_poll_worker: PollWorkerConfig默认轮询工作线程参数
Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
Sourcepub fn with_shutdown_timeout(self, timeout: Duration) -> Self
pub fn with_shutdown_timeout(self, timeout: Duration) -> Self
设置关闭超时时间
Sourcepub fn with_task_startup(self, config: TaskStartupConfig) -> Self
pub fn with_task_startup(self, config: TaskStartupConfig) -> Self
设置任务启动配置
Sourcepub fn with_health_check(self, config: HealthCheckConfig) -> Self
pub fn with_health_check(self, config: HealthCheckConfig) -> Self
设置健康检查配置
Sourcepub fn with_metrics(self, config: MetricsConfig) -> Self
pub fn with_metrics(self, config: MetricsConfig) -> Self
设置指标配置
Sourcepub fn with_default_poll_worker(self, config: PollWorkerConfig) -> Self
pub fn with_default_poll_worker(self, config: PollWorkerConfig) -> Self
设置默认轮询工作线程参数
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§impl Debug for RuntimeConfig
impl Debug for RuntimeConfig
Auto Trait Implementations§
impl Freeze for RuntimeConfig
impl RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl UnsafeUnpin for RuntimeConfig
impl UnwindSafe for RuntimeConfig
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