pub struct FanExecutor {
pub global_timeout: Option<Duration>,
}Expand description
Drives concurrent fan-out / fan-in execution.
FanExecutor is stateless and can be reused across multiple
FanPattern executions.
Fields§
§global_timeout: Option<Duration>Global default timeout applied when neither the task nor the pattern specifies one.
Implementations§
Source§impl FanExecutor
impl FanExecutor
Sourcepub fn with_global_timeout(self, timeout: Duration) -> Self
pub fn with_global_timeout(self, timeout: Duration) -> Self
Set a global default timeout.
Sourcepub async fn execute(
&self,
pattern: FanPattern,
) -> Result<FanInResult, FanError>
pub async fn execute( &self, pattern: FanPattern, ) -> Result<FanInResult, FanError>
Execute a FanPattern and return the aggregated FanInResult.
§Errors
Returns FanError::AllFailed when every task fails and the strategy
requires at least one success. Returns FanError::SomeFailed under
CollectAll when any task fails. Returns FanError::TaskTimeout
when a task exceeds its timeout.
Trait Implementations§
Source§impl Clone for FanExecutor
impl Clone for FanExecutor
Source§fn clone(&self) -> FanExecutor
fn clone(&self) -> FanExecutor
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 moreSource§impl Debug for FanExecutor
impl Debug for FanExecutor
Source§impl Default for FanExecutor
impl Default for FanExecutor
Source§fn default() -> FanExecutor
fn default() -> FanExecutor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FanExecutor
impl RefUnwindSafe for FanExecutor
impl Send for FanExecutor
impl Sync for FanExecutor
impl Unpin for FanExecutor
impl UnsafeUnpin for FanExecutor
impl UnwindSafe for FanExecutor
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