def receive_packet(response)
      pending_pos = nil
      pending_callback = nil
      @pending.each_with_index do |(pending_opaque,pending_cb),i|
        if response[:opaque] == pending_opaque
          pending_pos = i
          pending_callback = pending_cb
          break
        end
      end

      if pending_pos
        @pending = @pending[pending_pos..-1]
        begin
          if pending_callback.call(response) != :proceed
            @pending.shift
          end
        rescue Exception => e
          $stderr.puts "#{e.class}: #{e}\n" + e.backtrace.join("\n")
        end
      end
    end
def receive_packet(response)
      pending_pos = nil
      pending_callback = nil
      @pending.each_with_index do |(pending_opaque,pending_cb),i|
        if response[:opaque] == pending_opaque
          pending_pos = i
          pending_callback = pending_cb
          break
        end
      end

      if pending_pos
        @pending = @pending[pending_pos..-1]
        begin
          if pending_callback.call(response) != :proceed
            @pending.shift
          end
        rescue Exception => e
          $stderr.puts "#{e.class}: #{e}\n" + e.backtrace.join("\n")
        end
      end
    end
memcached responses possess the same order as their
 corresponding requests. Therefore quiet requests that have not
 yielded responses will be dropped silently to free memory from
 +@pending+

 When a callback has been fired and returned +:proceed+ without a
 succeeding packet, we still keep it referenced around for
 commands such as STAT which has multiple response packets.