| 69 | |
| 70 | template <typename Task> |
| 71 | static ResultPtr RunDelayed(base::DelayedThreadPool::Duration const & duration, Task && t) |
| 72 | { |
| 73 | ResultPtr result(new Result(Instance().GetNextId())); |
| 74 | auto const pushResult = |
| 75 | Instance().m_workerThread.PushDelayed(duration, [result, t = std::forward<Task>(t)]() mutable |
| 76 | { |
| 77 | t(); |
| 78 | Instance().Notify(result->Finish()); |
| 79 | }); |
| 80 | |
| 81 | if (!pushResult.m_isSuccess) |
| 82 | return {}; |
| 83 | |
| 84 | return result; |
| 85 | } |
| 86 | |
| 87 | // Asynchronous execution for tasks when execution order matters. |
| 88 | template <typename Task> |
nothing calls this directly
no test coverage detected