Module: Rmpd::Command::IdleStrategy

Defined in:
lib/rmpd/command.rb

Instance Method Summary collapse

Instance Method Details

#execute(connection, *args, &block) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rmpd/command.rb', line 43

def execute(connection, *args, &block)
  connection.send_command(@name, *args)
  if block_given?
    yield connection.socket rescue nil
    connection.send_command("noidle")
  end
  Response.factory(@name).parse(connection.read_response)
rescue EOFError
  puts "IdleStrategy EOFError received, retrying" if $DEBUG
  connection.close
  retry
end