24#ifndef DETERMINISTICESPASYNCWEBSERVER_WORKER_H
25#define DETERMINISTICESPASYNCWEBSERVER_WORKER_H
User-facing configuration for DeterministicESPAsyncWebServer.
void detws_worker_set_self(int id)
Bind the calling task/thread to worker id id (worker entry / tests).
int detws_worker_count(void)
Number of server worker tasks (DETWS_WORKER_COUNT).
int detws_worker_self(void)
Worker id [0, count) of the calling task; 0 by default / single-worker.
void(* detws_worker_pump_fn)(int worker_id)
Pump callback run by each worker task with its worker id.
void detws_workers_stop(void)
Signal the worker task(s) to exit and wait briefly for them. No-op on host.
bool detws_workers_running(void)
True while worker task(s) are running (always false on host).
void detws_workers_start(detws_worker_pump_fn pump)
Spawn the worker task(s) and start them running pump. No-op on host.
void(* detws_deferred_fn)(void *arg)
Deferred callback signature.
bool detws_defer(int worker_id, detws_deferred_fn fn, void *arg)
Run fn(arg) on worker worker_id. Returns false if the queue is full.
void detws_worker_wake(int worker_id)
Wake worker worker_id so it services a freshly-queued event now.
void detws_worker_run_deferred(int worker_id)
Drain and run worker worker_id's deferred callbacks (called by the worker).