drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.52k stars 1.1k forks source link

How to get default IO loops #968

Closed hwc0919 closed 3 years ago

hwc0919 commented 3 years ago

How to get default IO loops that drogon creates in app::run()? I noticed it is a member of a private class, ListenerManager::ioLoops_, and there is no public methods to get it.

I want to register some channels for my business logic when program starts, but don't want to create new threads. Is there any way to get it?

To be specific, I want to create my dbclient (my own implementation) on each threads.

hwc0919 commented 3 years ago

Forgive my carelessness, I found the method you provide.

trantor::EventLoop *HttpAppFrameworkImpl::getIOLoop(size_t id) const;