pub struct ParallelController { /* private fields */ }Expand description
Adaptive parallelism controller with backpressure
Implementations§
Source§impl ParallelController
impl ParallelController
Sourcepub fn new(config: ParallelConfig) -> Self
pub fn new(config: ParallelConfig) -> Self
Create a new parallel controller
Sourcepub async fn process_parallel<T, F, Fut, R>(
&self,
items: Vec<WorkItem<T>>,
processor: F,
) -> Vec<Result<R, String>>
pub async fn process_parallel<T, F, Fut, R>( &self, items: Vec<WorkItem<T>>, processor: F, ) -> Vec<Result<R, String>>
Process work items with adaptive parallelism and backpressure
Sourcepub fn metrics(&self) -> ParallelMetrics
pub fn metrics(&self) -> ParallelMetrics
Get current performance metrics
Sourcepub fn reset_metrics(&self)
pub fn reset_metrics(&self)
Reset metrics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParallelController
impl !RefUnwindSafe for ParallelController
impl Send for ParallelController
impl Sync for ParallelController
impl Unpin for ParallelController
impl !UnwindSafe for ParallelController
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> 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