Closed JustBlackBird closed 8 years ago
+1
More that year passed since I opened the issue. Now I see that reconnection should not be done inside of MPD client. Such features should be implemented at higher level, for example in a kind of pool.
If someone interested, there is a Generic Pool for node.js which could be easily turned into MPD pool with reconnection and all other fancy stuff.
@JustBlackBird thanks for the solution advice, but how did you manage the generic pool to reconnect? I have followed the steps 1 and 2 on the generic-pool's README file, but right after first attempt my application terminates.
@ozanmuyes here is an example of how I use Generic Pool with MPD client.
@JustBlackBird thank you.
The can be cases when connection to MPD server is lost. I think it will be useful to have a
reconnect
method inside of MPD client. In this case client code can just restore the connection without creating a new instance of MPD client.I could provide a PR with such feature if the maintainer is interested in it.