25 virtual void post(std::function<
void()> fn) = 0;
Minimal executor: deferred execution plus one-shot timers.
Definition executor.hpp:20
virtual TimerId schedule_after(std::chrono::milliseconds delay, std::function< void()> fn)=0
Run fn once after delay. Returns a handle usable with cancel.
virtual ~Executor()=default
virtual void post(std::function< void()> fn)=0
Run fn soon, on the executor (never inline / re-entrantly).
virtual void cancel(TimerId id)=0
Cancel a pending timer (no-op if it already fired or was cancelled).
std::uint64_t TimerId
Opaque handle to a scheduled timer; invalid_timer means "no timer".
Definition executor.hpp:14
constexpr TimerId invalid_timer
Definition executor.hpp:15