pub trait WaitForCompletion<T, Args>: Backend<Args> {
type ResultStream: Stream<Item = Result<TaskResult<T>, Self::Error>> + Send + 'static;
// Required methods
fn wait_for(
&self,
task_ids: impl IntoIterator<Item = TaskId<Self::IdType>>,
) -> Self::ResultStream;
fn check_status(
&self,
task_ids: impl IntoIterator<Item = TaskId<Self::IdType>> + Send,
) -> impl Future<Output = Result<Vec<TaskResult<T>>, Self::Error>> + Send;
// Provided method
fn wait_for_single(
&self,
task_id: TaskId<Self::IdType>,
) -> Self::ResultStream { ... }
}Expand description
Allows waiting for tasks to complete and checking their status
Required Associated Types§
Sourcetype ResultStream: Stream<Item = Result<TaskResult<T>, Self::Error>> + Send + 'static
type ResultStream: Stream<Item = Result<TaskResult<T>, Self::Error>> + Send + 'static
The result stream type yielding task results
Required Methods§
Sourcefn wait_for(
&self,
task_ids: impl IntoIterator<Item = TaskId<Self::IdType>>,
) -> Self::ResultStream
fn wait_for( &self, task_ids: impl IntoIterator<Item = TaskId<Self::IdType>>, ) -> Self::ResultStream
Wait for multiple tasks to complete, yielding results as they become available
Sourcefn check_status(
&self,
task_ids: impl IntoIterator<Item = TaskId<Self::IdType>> + Send,
) -> impl Future<Output = Result<Vec<TaskResult<T>>, Self::Error>> + Send
fn check_status( &self, task_ids: impl IntoIterator<Item = TaskId<Self::IdType>> + Send, ) -> impl Future<Output = Result<Vec<TaskResult<T>>, Self::Error>> + Send
Check current status of tasks without waiting
Provided Methods§
Sourcefn wait_for_single(&self, task_id: TaskId<Self::IdType>) -> Self::ResultStream
fn wait_for_single(&self, task_id: TaskId<Self::IdType>) -> Self::ResultStream
Wait for a single task to complete, yielding its result
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.