template<typename T>
Future class
class to access the result of task execution
Contents
tf::
tf::Executor executor; tf::Taskflow taskflow; for(int i=0; i<1000; i++) { taskflow.emplace([](){ std::this_thread::sleep_for(std::chrono::seconds(1)); }); } // submit the taskflow tf::Future fu = executor.run(taskflow); // request to cancel the submitted execution above fu.cancel(); // wait until the cancellation finishes fu.get();
Constructors, destructors, conversion operators
Public functions
Function documentation
template<typename T>
bool tf:: Future<T>:: cancel()
cancels the execution of the running taskflow associated with this future object
Returns | true if the execution can be cancelled or false if the execution has already completed |
---|