129 std::unique_ptr<struct MultiLoopImpl> impl_;
MessageLoop()
Constructs a MessageLoop with kNormalType queue.
std::function< void()> Callback
Callback type for tasks and event handlers.
Definition message_loop.h:111
Type
Queue implementation type.
Definition message_loop.h:119
MultiLoop(size_t thread_num, Type type)
Constructs a MultiLoop with a specific queue type.
bool is_in_same_thread() const override
Returns true if the calling thread is one of the worker threads.
MultiLoop(size_t thread_num=4U)
Constructs a MultiLoop with the default kNormalType queue and thread_num workers.
void on_task_changed(Callback &&callback, uint32_t start_time) override
Called on the worker thread executing the task, before the task runs.
void on_end() override
Called once on each worker thread just before it exits.
~MultiLoop() override
Destructor. Quits the loop and joins all worker threads.
void on_begin() override
Called once on each worker thread immediately after it starts.
#define VLINK_EXPORT
Definition macros.h:85
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition macros.h:184
Single-threaded event loop with three queue types, timer management and task scheduling.