| 40 | |
| 41 | template <class Func> |
| 42 | void delayedTask(Func&& func, std::size_t ms) { |
| 43 | std::thread( |
| 44 | [f = std::move(func), ms](Executor* ex) { |
| 45 | std::this_thread::sleep_for(std::chrono::milliseconds(ms)); |
| 46 | ex->schedule(std::move(f)); |
| 47 | }, |
| 48 | &_executor) |
| 49 | .detach(); |
| 50 | } |
| 51 | |
| 52 | template <class T> |
| 53 | struct Awaiter { |