gompd icon indicating copy to clipboard operation
gompd copied to clipboard

Possibility to expose Watcher.Client to avoid duplicate connection?

Open dunrix opened this issue 2 years ago • 0 comments

https://github.com/fhs/gompd/blob/c269f23a98e34a26322620c35e756cb4da0bfc6d/mpd/watcher.go#L8-L9

contains unexported reference to Client instance.

Now when I need both watcher for mpd's subsystem events and also retrieve current song information, I have to create another instance with DialAuthenticated, while there is already one.

Would it be possible to allow shared access to Watcher's connection instance? I'm aware there can be a conflicting behavior, like closing from other party but such situations can happen by external causes anyway and connection instance should be handled in a defensive way in all cases.

dunrix avatar Oct 22 '22 16:10 dunrix