[−][src]Function desync::scheduler::future_sync
pub fn future_sync<'a, TFn, TFuture>(
queue: &Arc<JobQueue>,
job: TFn
) -> impl 'a + Future<Output = Result<TFuture::Output, Canceled>> + Send where
TFn: 'a + Send + FnOnce() -> TFuture,
TFuture: 'a + Send + Future,
TFuture::Output: Send,
Schedules a job to run and returns a future for retrieving the result
The future will cancel if the return value is discarded, and will run in the current execution context. These futures are
more complex to schedule than future_desync
futures, but the callback function has a shorter lifespan making it easier
to use when borrowing values.