Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,25 @@ impl<T: 'static + Send> ParallelTaskSet<T> {
pub async fn join_remaining(self) -> Vec<T> {
self.set.join_all().await
}

/// Returns the number of tasks currently in this set.
pub fn len(&self) -> usize {
self.set.len()
}

/// Returns `true` if this set is currently empty.
pub fn is_empty(&self) -> bool {
self.set.is_empty()
}

/// Returns the maximum number of tasks that may be on this set at any given
/// time.
///
/// See [the type-level documentation](ParallelTaskSet#limiting-parallelism)
/// for more details.
pub fn max_parallelism(&self) -> NonZeroUsize {
self.max_parallelism
}
}

/// An iterator over the outputs of completed tasks, returned by
Expand Down
Loading