pub struct AsyncOptimizer { /* private fields */ }Expand description
Async operation optimizer with timeouts and retries
Implementations§
Source§impl AsyncOptimizer
impl AsyncOptimizer
Sourcepub fn new(max_concurrent: usize, default_timeout: Duration) -> Self
pub fn new(max_concurrent: usize, default_timeout: Duration) -> Self
Create new async optimizer
Sourcepub async fn execute<F, T>(&self, future: F) -> Result<T, AsyncError>
pub async fn execute<F, T>(&self, future: F) -> Result<T, AsyncError>
Execute future with optimization
Sourcepub async fn execute_with_timeout<F, T>(
&self,
future: F,
timeout_duration: Duration,
) -> Result<T, AsyncError>
pub async fn execute_with_timeout<F, T>( &self, future: F, timeout_duration: Duration, ) -> Result<T, AsyncError>
Execute future with custom timeout
Sourcepub async fn execute_with_retry<F, Fut, T>(
&self,
operation: F,
) -> Result<T, AsyncError>
pub async fn execute_with_retry<F, Fut, T>( &self, operation: F, ) -> Result<T, AsyncError>
Execute with retry logic
Sourcepub async fn batch_execute<F, T>(
&self,
operations: Vec<F>,
) -> Vec<Result<T, AsyncError>>
pub async fn batch_execute<F, T>( &self, operations: Vec<F>, ) -> Vec<Result<T, AsyncError>>
Batch execute multiple operations
Auto Trait Implementations§
impl Freeze for AsyncOptimizer
impl !RefUnwindSafe for AsyncOptimizer
impl Send for AsyncOptimizer
impl Sync for AsyncOptimizer
impl Unpin for AsyncOptimizer
impl !UnwindSafe for AsyncOptimizer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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