Struct scoped_pool::Scope
[−]
[src]
pub struct Scope<'scope> { // some fields omitted }
An execution scope, represents a set of jobs running on a Pool.
Methods
impl<'scope> Scope<'scope>
[src]
fn forever(pool: Pool) -> Scope<'static>
Create a Scope which lasts forever.
fn execute<F>(&self, job: F) where F: FnOnce() + Send + 'scope
Add a job to this scope.
Subsequent calls to join
will wait for this job to complete.
fn zoom<'smaller, F, R>(&self, scheduler: F) -> R where F: FnOnce(&Scope<'smaller>) -> R, 'scope: 'smaller
Create a new subscope, bound to a lifetime smaller than our existing Scope.
The subscope has a different job set, and is joined before zoom returns.
fn join(&self)
Awaits all jobs submitted on this Scope to be completed.
Only guaranteed to join jobs which where execute
d logically
prior to join
. Jobs execute
d concurrently with join
may
or may not be completed before join
returns.