MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / schedule

Method schedule

include/fc/thread/thread.hpp:91–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 */
90 template<typename Functor>
91 auto schedule( Functor&& f, const fc::time_point& when,
92 const char* desc FC_TASK_NAME_DEFAULT_ARG, priority prio = priority()) -> fc::future<decltype(f())> {
93 typedef decltype(f()) Result;
94 fc::task<Result,sizeof(Functor)>* tsk =
95 new fc::task<Result,sizeof(Functor)>( fc::forward<Functor>(f), desc );
96 fc::future<Result> r(fc::shared_ptr< fc::promise<Result> >(tsk,true) );
97 async_task(tsk,prio,when);
98 return r;
99 }
100
101 /**
102 * This method will cancel all pending tasks causing them to throw cmt::error::thread_quit.

Callers 1

scheduleFunction · 0.80

Calls 1

priorityClass · 0.70

Tested by

no test coverage detected