pub struct AsyncExecutor;Expand description
Async graph executor using tokio tasks.
§Example
use oximedia_graph::async_exec::{AsyncExecutor, AsyncExecutorConfig};
use oximedia_graph::scheduler::ExecutionPlan;
async fn run_graph(plan: ExecutionPlan) {
let config = AsyncExecutorConfig::default();
let (results, stats) = AsyncExecutor::run(&plan, config, |node_id| async move {
// Perform async I/O for this node.
Ok::<(), String>(())
}).await;
}Implementations§
Source§impl AsyncExecutor
impl AsyncExecutor
Sourcepub async fn run<F, Fut>(
plan: &ExecutionPlan,
config: AsyncExecutorConfig,
executor: F,
) -> (Vec<ParallelNodeResult>, ParallelRunStats)
pub async fn run<F, Fut>( plan: &ExecutionPlan, config: AsyncExecutorConfig, executor: F, ) -> (Vec<ParallelNodeResult>, ParallelRunStats)
Execute the plan asynchronously.
executor is an async factory that receives a node ID (owned String)
and returns a future resolving to Result<(), String>.
Returns the collected per-node results and aggregate statistics.
Auto Trait Implementations§
impl Freeze for AsyncExecutor
impl RefUnwindSafe for AsyncExecutor
impl Send for AsyncExecutor
impl Sync for AsyncExecutor
impl Unpin for AsyncExecutor
impl UnsafeUnpin for AsyncExecutor
impl UnwindSafe for AsyncExecutor
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