pub struct TaskFuture { /* private fields */ }Expand description
A future that tracks completion of submitted tasks
TaskFuture provides both blocking and non-blocking ways to wait for
task completion, with efficient condition variable notification.
Tasks can be checked for completion, waited on indefinitely, or
waited on with a timeout.
Implementations§
Source§impl TaskFuture
impl TaskFuture
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all tasks are complete without blocking
Returns true if all tasks have finished execution.
This is a non-blocking operation using atomic loads.
Sourcepub fn wait(self)
pub fn wait(self)
Wait for all tasks to complete
This method blocks the current thread until all tasks finish. It uses efficient condition variable notification to minimize CPU usage while waiting.
Sourcepub fn wait_timeout(self, timeout: Duration) -> bool
pub fn wait_timeout(self, timeout: Duration) -> bool
Wait for all tasks to complete with a timeout
Returns true if all tasks completed within the timeout,
false if the timeout was reached first.
Sourcepub fn remaining_count(&self) -> usize
pub fn remaining_count(&self) -> usize
Get the approximate number of remaining incomplete tasks
This provides a way to monitor progress of task batches. The count is approximate due to relaxed atomic ordering. Not for precise synchronization.
Trait Implementations§
Source§impl Clone for TaskFuture
impl Clone for TaskFuture
Source§fn clone(&self) -> TaskFuture
fn clone(&self) -> TaskFuture
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more