3.2 Connection Idioms

Among MPD clients, there are two idioms for sending commands while receiving notifications of server-side changes:

  1. just maintain two connections (e.g. mpdfav); issue the “idle” command on one, send commands on the other
  2. use one connection, issue the “idle” command, and when asked to issue another command, send “noidle”, issue the requested command, collect the response, and then send “idle” again (e.g. libmpdel). Note that this is not a race condition per the MPD docs – any server-side changes that took place while processing the command will be saved & returned on “idle”

As a library, elmpd does not make that choice, but rather supports both styles. To create a connection in the second style, supply the :subsystems argument. To create a connection solely for dispatching commands, omit it.