refactor: allow hot swapping the config#192
Conversation
We introduce shared listeners that allow us to keep an old config running while we set up a new config. This is done by keeping track of the usage of the listeners and only closing them when the last user is done with the shared listener.
fortuna
left a comment
There was a problem hiding this comment.
I think we need to readjust some things. Happy to brainstorm more.
707bc35 to
80e5d49
Compare
Added a read and close channel to the virtual packet connection. |
18e407a to
4730d74
Compare
fortuna
left a comment
There was a problem hiding this comment.
The new structure looks nicer. The main things now is the new virtual packet conn, which needs a redesign, and the RefCount can probably go away.
851ac28 to
8f9f1ea
Compare
sbruens
left a comment
There was a problem hiding this comment.
This is ready for another look, @fortuna please take a look specifically at the packet conn handling. I ended up using a read and a response channel. I think this resolves the issue you pointed out, but I'm curious to hear what you think.
fortuna
left a comment
There was a problem hiding this comment.
Looks good. Just some small clean ups.
Also, is there a benchmark that exercises that code that we can check to make sure it's fine?
Instead of keeping track of a diff of ports to keep open, we introduce reusable listeners that can be hot-swapped by remaining open until the last user of the listener closes it.
This pulls out the listener changes from #182, which is focused on adding a new config format.