Module: Rmpd::Command::CommandListOkStrategy

Defined in:
lib/rmpd/command.rb

Instance Method Summary collapse

Instance Method Details

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



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/rmpd/command.rb', line 108

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

  connection.send_command("command_list_ok_begin")
  @list.map do |command_w_args|
    connection.send_command(*command_w_args)
  end
  connection.send_command("command_list_end")
  handle_command_list_ok_response(connection.read_response)
rescue EOFError
  puts "CommandListOkStrategy EOFError received, retrying" if $DEBUG
  connection.close
  retry
end