51 const auto end = byExpiration.upper_bound(now);
52 std::vector<Event> expired;
53 std::move(byExpiration.begin(),
end, std::back_inserter(expired));
54 byExpiration.erase(byExpiration.begin(),
end);
55 for (
const auto& event : expired) {
58 if (event.repeatInterval >= 0) {
60 now +
event.repeatInterval,
67 for (
const auto& event : expired) {
68 event.callback(event.id, now);
71 }
while (!onceOnly && nextExp <= now);
Id add(int64_t now, int64_t delay, Callback callback)
constexpr detail::Map< Move > move
std::chrono::steady_clock::time_point now()
auto begin(TestAdlIterable &instance)
—— Concurrent Priority Queue Implementation ——
int64_t nextExpiration() const
std::function< void(Id, int64_t)> Callback
auto end(TestAdlIterable &instance)
Id addRepeating(int64_t now, int64_t interval, Callback callback)
int64_t runInternal(int64_t now, bool runOnce)