18#include <trantor/exports.h>
29class TRANTOR_EXPORT EventLoopThreadPool : NonCopyable
32 EventLoopThreadPool() =
delete;
41 const std::string &name =
"EventLoopThreadPool");
63 return loopThreadVector_.size();
90 std::vector<std::shared_ptr<EventLoopThread>> loopThreadVector_;
91 std::atomic<size_t> loopIndex_{0};
EventLoop * getNextLoop()
Get the next event loop in the pool.
EventLoop * getLoop(size_t id)
Get the event loop in the id position in the pool.
void wait()
Wait for all event loops in the pool to quit.
void start()
Run all event loops in the pool.
std::vector< EventLoop * > getLoops() const
Get all event loops in the pool.
EventLoopThreadPool(size_t threadNum, const std::string &name="EventLoopThreadPool")
Construct a new event loop thread pool instance.
size_t size()
Return the number of the event loop.
Definition EventLoopThreadPool.h:61
As the name implies, this class represents an event loop that runs in a particular thread....
Definition EventLoop.h:56
Definition EventLoop.h:34