template <class Ret>
Represents a job that can be executed in another thread and can return a value. It is similar to future/promise pattern, but it allows cancelation and is based on U++ thread pool shared with CoWork. AsyncWork has pick constructor / operator.
template < class Function, class... Args>
void Do(Function&& f, Args&&... args)
Schedules job f with parameters args to be asynchronously performed in (possibly) another thread.
Cancels the job.
static bool IsCanceled()
Returns true in the job routine if the master AsyncWork was canceled.
Returns true if job was finished.
Waits for job to be finished (if necessary), then returns the return value of f. If there was exception, it is rethrown.
Same as Get().
If work has not be finished, destructor cancels it.
auto Async(Function&& f, Args&&... args)
Returns AsyncWork for given job f with args.