dcrdex
dcrdex copied to clipboard
client: Update connection master and wsconn.
ConnectionMaster is useful for avoiding monotonous boilerplate from bubbling up with both context,Context and sync.WaitGroup. It just combines their functionality and provides friendly-named methods for their uses.
ConnectOnce should go.
wsConn shouldn't even be handling reconnects to be honest. The caller should do that. That way we don't need all the reconnect messaging either. A ConnectionMaster can be restarted, which is nice.
WsConn shouldn't be handling msgjson type either. We can write functionality in the msgjson package to handle some of that stuff. I think the idea there is that gorilla uses a json.Decoder internally that allows for decoding of streams, but maybe we can pass the stream up, somehow?
Feel free to tackle any of these problems.
Originally posted by @buck54321 in https://github.com/decred/dcrdex/issues/3182#issuecomment-2654593450
@norwnd here you go. Shall I assign you? linking #3180 which has some discussion on the issue.
Actually cant assign you through ui for some reason, unsure what the prerequisites are, will look into it.
Apparently I can if you comment here.
Hey, yeah I'll take a look once I have time
@norwnd are you still on it?
If not @JoeGruffins, you can assign me to this.
Let me ping them on matrix. Ill post back.