Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to expose Watcher.Client to avoid duplicate connection? #83

Open
dunrix opened this issue Oct 22, 2022 · 0 comments
Open

Possibility to expose Watcher.Client to avoid duplicate connection? #83

dunrix opened this issue Oct 22, 2022 · 0 comments

Comments

@dunrix
Copy link

dunrix commented Oct 22, 2022

gompd/mpd/watcher.go

Lines 8 to 9 in c269f23

type Watcher struct {
conn *Client // client connection to MPD

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant