|
| ServiceGroup (const std::shared_ptr< thread::IoThreadPool > &pPool, const std::string &name) |
| Creates a group around pPool and name. More...
|
|
size_t | numServices () const |
| Gets the number of services. More...
|
|
template<typename TService > |
auto | registerService (const std::shared_ptr< TService > &pService) |
| Registers an externally created service (pService) for cleanup. More...
|
|
template<typename TFactory , typename... TArgs> |
auto | pushService (TFactory factory, TArgs &&... args) |
| Creates a new service by calling factory with args service arguments. More...
|
|
void | shutdown () |
| Safely shuts down the service group. More...
|
|
A group of services that should be shutdown together and might be interdependent.
- Note
- AsyncTcpServer and accept handlers (PacketReaders, PacketWriters) have such a shutdown requirement because AsyncTcpServer includes a shared_ptr to itself as part of its accepted PacketSocket, which is then kept alive by the accept handlers until they are also shutdown.