Module: Rmpd::Command::CommandListStrategy

Defined in:
lib/rmpd/command.rb

Instance Method Summary collapse

Instance Method Details

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



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/rmpd/command.rb', line 88

def execute(connection, *args, &block)
  list = List.new
  yield list

  connection.send_command("command_list_begin")
  list.map do |command_w_args|
    connection.send_command(*command_w_args)
  end
  connection.send_command("command_list_end")
  Response.factory(@name).parse(connection.read_response)
rescue EOFError
  puts "CommandListStrategy EOFError received, retrying" if $DEBUG
  connection.close
  retry
end