mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Renave queue_adjust
to on_idle
(#442)
This commit is contained in:
parent
5928e0af1a
commit
d359e3a5f7
1 changed files with 4 additions and 2 deletions
|
@ -367,9 +367,11 @@ class TaskQueue {
|
|||
public:
|
||||
TaskQueue() = default;
|
||||
virtual ~TaskQueue() = default;
|
||||
|
||||
virtual void enqueue(std::function<void()> 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue