C++: Improvements to BasePool/SubscriberPool
My work on a logger has sparked some necessary improvements to the pools:
- returning a
const std::map
of sockets fromBasePool
doesn't allow you to do anything with the sockets because they always change (e.g. set an option). - the nice
subscribe
andunsubscribe
methods consequently didn't work, didn't even compile which only works because the template is not used anywhere (yet) - it turns out that setting a fixed list of topics to subscribe to at startup is too restrictive. I now allow providing a lambda that generates the topics at the time a socket joins.