def pop
      m = nil
      @lock.synchronize do
        [:PRIORITY, :NEW, :NORMAL, :WHOCARES].each do |k|
          unless(@queues[k].empty?)
            q = @queues[k].shift
            unless(q.empty?)
              m = q.shift
              add_queue(k, q) unless(q.empty?)
              break
            end
          end
        end
      end
      unless(m)
        if(@raise)
          raise EmptyQueue.new('Queue is currently empty')
        else
          @lock.wait_while{ empty? }
          m = pop
        end
      end
      m
    end
def pop
      m = nil
      @lock.synchronize do
        [:PRIORITY, :NEW, :NORMAL, :WHOCARES].each do |k|
          unless(@queues[k].empty?)
            q = @queues[k].shift
            unless(q.empty?)
              m = q.shift
              add_queue(k, q) unless(q.empty?)
              break
            end
          end
        end
      end
      unless(m)
        if(@raise)
          raise EmptyQueue.new('Queue is currently empty')
        else
          @lock.wait_while{ empty? }
          m = pop
        end
      end
      m
    end
raise_e:: raise an exception on empty
 Returns the next message to send. This method decides what
 message to send based on the priority of the message. It
 will throw an Exceptions::EmptyQueue when there are no messages
 left.