pub struct AdaptiveScopeStrategy {
pub default: WorkerScope,
pub on_escalation: WorkerScope,
pub on_high_failure: WorkerScope,
pub failure_threshold: u32,
}Expand description
適応的 Scope 戦略
Worker の状態に応じて動的にスコープを変更する戦略。
- 通常時:
defaultスコープ - Escalation 中:
on_escalationスコープ - 連続失敗時:
on_high_failureスコープ
Fields§
§default: WorkerScope通常時のスコープ
on_escalation: WorkerScopeEscalation 時のスコープ
on_high_failure: WorkerScope連続失敗時のスコープ
failure_threshold: u32失敗閾値(この回数以上連続失敗すると on_high_failure を適用)
Implementations§
Source§impl AdaptiveScopeStrategy
impl AdaptiveScopeStrategy
Sourcepub fn with_default(self, scope: WorkerScope) -> Self
pub fn with_default(self, scope: WorkerScope) -> Self
通常時のスコープを設定
Sourcepub fn with_on_escalation(self, scope: WorkerScope) -> Self
pub fn with_on_escalation(self, scope: WorkerScope) -> Self
Escalation 時のスコープを設定
Sourcepub fn with_on_high_failure(self, scope: WorkerScope) -> Self
pub fn with_on_high_failure(self, scope: WorkerScope) -> Self
連続失敗時のスコープを設定
Sourcepub fn with_failure_threshold(self, threshold: u32) -> Self
pub fn with_failure_threshold(self, threshold: u32) -> Self
失敗閾値を設定
Trait Implementations§
Source§impl Clone for AdaptiveScopeStrategy
impl Clone for AdaptiveScopeStrategy
Source§fn clone(&self) -> AdaptiveScopeStrategy
fn clone(&self) -> AdaptiveScopeStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdaptiveScopeStrategy
impl Debug for AdaptiveScopeStrategy
Source§impl Default for AdaptiveScopeStrategy
impl Default for AdaptiveScopeStrategy
Source§impl ScopeStrategy for AdaptiveScopeStrategy
impl ScopeStrategy for AdaptiveScopeStrategy
Source§fn determine_scope(
&self,
context: &TaskContext,
worker_id: WorkerId,
) -> WorkerScope
fn determine_scope( &self, context: &TaskContext, worker_id: WorkerId, ) -> WorkerScope
Worker の Scope を決定 Read more
Auto Trait Implementations§
impl Freeze for AdaptiveScopeStrategy
impl RefUnwindSafe for AdaptiveScopeStrategy
impl Send for AdaptiveScopeStrategy
impl Sync for AdaptiveScopeStrategy
impl Unpin for AdaptiveScopeStrategy
impl UnwindSafe for AdaptiveScopeStrategy
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
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>
Converts
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>
Converts
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