Purge all undelivered messages from the queue.

        This method is a :ref:`coroutine <coroutine>`.
977212
def purge(self):
        
        self.sender.send_QueuePurge(self.name)
        yield from self.synchroniser.wait(spec.QueuePurgeOK)
        self.reader.ready()
1007826
async def _handle_state_forgotten(self, message):
        
        self._send_queue.append(RequestState(MsgsStateInfo(
            req_msg_id=message.msg_id, info=chr(1) * len(message.obj.msg_ids)),
            loop=self._loop))
640707
def _empty_queue(self):
        """"""

        while True:
            try:
                # Remove unused points from the queue.
                self.queue.pop()
                self.unused += 1  # add to the total number of unused points
                self.nqueue -= 1
            except:
                # If the queue is empty, we're done!
                self.nqueue = 0
                break
693612
def clear(self):
        
        with self._hlock:
            self.handlers.clear()
        with self._mlock:
            self.memoize.clear()
227906
def flush(self, queue_name):
        
        for name in (queue_name, dq_name(queue_name)):
            self.do_purge(name)
1122327
function flush() {
    if (queue.length) {
      //
      // We might want to indicate that these are already queued, so we don't
      // fetch data again.
      //
      queue.splice(0).sort(function sort(a, b) {
        return a.id - b.id;
      }).forEach(onmessage);
    }
  }
454342
def clear_queue(self):
        
        def remove_message(ch, method, properties, body):
            print("Removed message: %s" % body)
        self.input_channel.basic_consume(remove_message, queue=self.INPUT_QUEUE_NAME, no_ack=True)
        try:
            self.input_channel.start_consuming()
        except (KeyboardInterrupt, SystemExit):
            log.info(" Exiting")
            self.exit()
1358725
function clear_messages()
    {
        $this->last_error = null;
        $this->last_error_id = null;
        $this->last_query = null;
    }
1047748
def _flush(self):
        
        for consumer in self.consumers:
            if not getattr(consumer, "closed", False):
                consumer.flush()
1048001
public static void unwindMessages(final Object message, final List<Object> messages) {
        if (message instanceof Iterable) {
            @SuppressWarnings("rawtypes")
            final Iterator it = ((Iterable) message).iterator();
            while (it.hasNext())
                unwindMessages(it.next(), messages);
        } else
            messages.add(message);
    }
1030213
private void emptyQueue() {
        if (queue == null) {
            return;
        }
        int startSize = cacheMap.size();
        while (true) {
            @SuppressWarnings("unchecked")
            CacheEntry<K,V> entry = (CacheEntry<K,V>)queue.poll();
            if (entry == null) {
                break;
            }
            K key = entry.getKey();
            if (key == null) {
                // key is null, entry has already been removed
                continue;
            }
            CacheEntry<K,V> currentEntry = cacheMap.remove(key);
            // check if the entry in the map corresponds to the expired
            // entry. If not, readd the entry
            if ((currentEntry != null) && (entry != currentEntry)) {
                cacheMap.put(key, currentEntry);
            }
        }
        if (DEBUG) {
            int endSize = cacheMap.size();
            if (startSize != endSize) {
                System.out.println("*** Expunged " + (startSize - endSize)
                        + " entries, " + endSize + " entries left");
            }
        }
    }
785047
def clear(self):
    """"""
    while self.current or self.idlers or self.queue or self.rpcs:
      current = self.current
      idlers = self.idlers
      queue = self.queue
      rpcs = self.rpcs
      _logging_debug('Clearing stale EventLoop instance...')
      if current:
        _logging_debug('  current = %s', current)
      if idlers:
        _logging_debug('  idlers = %s', idlers)
      if queue:
        _logging_debug('  queue = %s', queue)
      if rpcs:
        _logging_debug('  rpcs = %s', rpcs)
      self.__init__()
      current.clear()
      idlers.clear()
      queue[:] = []
      rpcs.clear()
      _logging_debug('Cleared')
1239479
def clear_messages(self, queue_name, timeout=None):
        '''
        
        '''
        _validate_not_none('queue_name', queue_name)
        request = HTTPRequest()
        request.method = 'DELETE'
        request.host_locations = self._get_host_locations()
        request.path = _get_path(queue_name, True)
        request.query = {'timeout': _int_to_str(timeout)}
        self._perform_request(request)
311674
def cleanup(self):
        
        self.lock.acquire()
        logger.debug('Acquired lock in cleanup for ' + str(self))
        self.children = [child for child in self.children if child.is_alive()]
        self.lock.release()
1042510
def queue_purge(self, queue, **kwargs):
        """"""
        return self.channel.queue_purge(queue=queue).message_count
836955
def clean(self):
        
        for _, item in self.queue.items():
            if item['status'] in ['paused', 'running', 'stopping', 'killing']:
                item['status'] = 'queued'
                item['start'] = ''
                item['end'] = ''
726895
def flush(self, safe=None):
		''' '''
		result = None
		for index, op in enumerate(self.queue):
			try:
				result = op.execute()
			except:
				self.clear_queue()
				self.clear_cache()
				raise
		self.clear_queue()
		return result