Struct dispatch::Group [] [src]

pub struct Group {
    // some fields omitted
}

A Grand Central Dispatch group.

A Group is a mechanism for grouping closures and monitoring them. This allows for aggregate synchronization, so you can track when all the closures complete, even if they are running on different queues.

Methods

impl Group
[src]

fn create() -> Group

Creates a new dispatch Group.

fn enter(&self) -> GroupGuard

Indicates that a closure has entered self, and increments the current count of outstanding tasks. Returns a GroupGuard that should be dropped when the closure leaves self, decrementing the count.

fn async<F>(&self, queue: &Queue, work: F) where F: 'static + Send + FnOnce()

Submits a closure asynchronously to the given Queue and associates it with self.

fn notify<F>(&self, queue: &Queue, work: F) where F: 'static + Send + FnOnce()

Schedules a closure to be submitted to the given Queue when all tasks associated with self have completed. If self is empty, the closure is submitted immediately.

fn wait(&self)

Waits synchronously for all tasks associated with self to complete.

fn wait_timeout_ms(&self, ms: u32) -> bool

Waits for all tasks associated with self to complete within the specified duration. Returns true if the tasks completed or false if the timeout elapsed.

fn wait_timeout(&self, timeout: Duration) -> bool

Waits for all tasks associated with self to complete within the specified duration. Returns true if the tasks completed or false if the timeout elapsed.

fn is_empty(&self) -> bool

Returns whether self is currently empty.

Trait Implementations

impl Sync for Group
[src]

impl Send for Group
[src]

impl Clone for Group
[src]

fn clone(&self) -> Self

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Drop for Group
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more