Cancellable timers: sorted_list::remove, timer cancel, replace done flag with timer cancellation

This commit is contained in:
Ian Gulliver
2026-04-11 08:28:32 +09:00
parent 3a3c5873c3
commit e486f6501a
5 changed files with 48 additions and 18 deletions

View File

@@ -5,6 +5,7 @@
#include <optional>
#include <span>
#include "wire.h"
#include "timer_queue.h"
struct responder {
uint32_t message_id;
@@ -45,5 +46,6 @@ void typed_handler(responder resp, std::span<const uint8_t> payload) {
}
void dispatch_init();
void dispatch_schedule_ms(uint32_t ms, std::function<void()> fn);
timer_handle dispatch_schedule_ms(uint32_t ms, std::function<void()> fn);
bool dispatch_cancel_timer(timer_handle h);
[[noreturn]] void dispatch_run(std::span<const handler_entry> handlers);