diff --git a/httplib.h b/httplib.h index 922a5fb..02941f9 100644 --- a/httplib.h +++ b/httplib.h @@ -367,9 +367,11 @@ class TaskQueue { public: TaskQueue() = default; virtual ~TaskQueue() = default; + virtual void enqueue(std::function fn) = 0; - virtual void queue_adjust() { }; virtual void shutdown() = 0; + + virtual void on_idle(){}; }; class ThreadPool : public TaskQueue { @@ -3498,7 +3500,7 @@ inline bool Server::listen_internal() { auto val = detail::select_read(svr_sock_, 0, 100000); if (val == 0) { // Timeout - task_queue->queue_adjust(); + task_queue->on_idle(); continue; }