I use libuv for a small communication component that maintains set of persistent HTTPS connection between several nodes (mesh network). It works fine, however when I'm shutting down the component down I want to do a graceful connection shutdown for each connection. The way I implemented now is that I have a hash table of all connections and then iterate through the table and shut down every connection. This works alright as well, however it is real pain to troubleshoot this mix of asynchronous and functional code. What I was thinking is to have some sort of mechanism for custom events that for every connection I could register a listener that would be waiting for a specific event and then call a callback function. Then I could emit this event on the loop and each connection would shutdown itself. The Idea is that I do not have to maintain list of external references to each connection but they still can be reached trough the event loop. So, my question is if there is a sensible way to do it with libuv or if I should involve any other library? Thanks.
-- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
