def sync
      serialized_commands = @commands.map { |c| Protocol.build_command(*c) }
      connection.socket.write(serialized_commands.join)
      Array.new(@commands.size) { connection.read_response }
    ensure
      @commands.clear
    end
def sync
      serialized_commands = @commands.map { |c| Protocol.build_command(*c) }
      connection.socket.write(serialized_commands.join)
      Array.new(@commands.size) { connection.read_response }
    ensure
      @commands.clear
    end
Sends all commands at once and reads responses
 @return [Array] of responses