| 70 | } |
| 71 | |
| 72 | ScheduledCall GuiExecutor::CallEvery(const Duration& interval, std::function<void ()> fn) |
| 73 | { |
| 74 | assert(interval > Duration::zero()); |
| 75 | |
| 76 | unsigned id = GetCallId(); |
| 77 | auto at = std::chrono::steady_clock::now() + interval; |
| 78 | CallAsync([this, id, at, interval, fn]() |
| 79 | { |
| 80 | m_scheduledCalls.Insert(GuiExecutor::CallData(id, at, interval, fn)); |
| 81 | ResetTimer(); |
| 82 | }); |
| 83 | return MakeScheduledCall(id); |
| 84 | } |
| 85 | |
| 86 | void GuiExecutor::Cancel(const ScheduledCall& call) |
| 87 | { |