def handle_packet(queue, packet, header)
      begin
        # Continue to dispatch/ack requests even when terminating otherwise will block results
        # Ideally would reject requests when terminating but broker client does not yet support that
        case packet
        when Push, Request then dispatch_request(packet, queue)
        when Result        then deliver_response(packet)
        end
        @sender.message_received
      rescue Exception => e
        ErrorTracker.log(self, "#{queue} queue processing error", e)
      ensure
        # Relying on fact that all dispatches/deliveries are synchronous and therefore
        # need to have completed or failed by now, thus allowing packet acknowledgement
        header.ack
      end
      true
    end
def handle_packet(queue, packet, header)
      begin
        # Continue to dispatch/ack requests even when terminating otherwise will block results
        # Ideally would reject requests when terminating but broker client does not yet support that
        case packet
        when Push, Request then dispatch_request(packet, queue)
        when Result        then deliver_response(packet)
        end
        @sender.message_received
      rescue Exception => e
        ErrorTracker.log(self, "#{queue} queue processing error", e)
      ensure
        # Relying on fact that all dispatches/deliveries are synchronous and therefore
        # need to have completed or failed by now, thus allowing packet acknowledgement
        header.ack
      end
      true
    end
Handle packet from queue

 === Parameters
 queue(String):: Name of queue from which message was received
 packet(Packet):: Packet received
 header(AMQP::Frame::Header):: Packet header containing ack control

 === Return
 true:: Always return true