Purge all messages in a queue.
763046
def purge(self, queue, nowait=True, ticket=None, cb=None):
        '''
        
        '''
        nowait = nowait and self.allow_nowait() and not cb

        args = Writer()
        args.write_short(ticket or self.default_ticket).\
            write_shortstr(queue).\
            write_bit(nowait)
        self.send_frame(MethodFrame(self.channel_id, 50, 30, args))

        if not nowait:
            self._purge_cb.append(cb)
            return self.channel.add_synchronous_cb(self._recv_purge_ok)
969428
def Flush(self):
    """"""
    DB.DeleteSubjects(self.delete_subject_requests, sync=False)

    for req in self.delete_attributes_requests:
      subject, attributes, start, end = req
      DB.DeleteAttributes(subject, attributes, start=start, end=end, sync=False)

    for req in self.set_requests:
      subject, values, timestamp, replace, to_delete = req
      DB.MultiSet(
          subject,
          values,
          timestamp=timestamp,
          replace=replace,
          to_delete=to_delete,
          sync=False)

    if (self.delete_subject_requests or self.delete_attributes_requests or
        self.set_requests):
      DB.Flush()

    for queue, notifications in self.new_notifications:
      DB.CreateNotifications(queue, notifications)
    self.new_notifications = []

    self.delete_subject_requests = []
    self.set_requests = []
    self.delete_attributes_requests = []
425226
private void purgeChannel(MessageChannel channel) {
        if (channel instanceof QueueChannel) {
            List<Message<?>> messages = ((QueueChannel)channel).purge(messageSelector);
            
            if (log.isDebugEnabled()) {
                log.debug("Purged channel " + ((QueueChannel)channel).getComponentName() + " - removed " + messages.size() + " messages");
            }
        }
    }
1219764
def queue_purge(self, queue, **kwargs):
        """"""
        qsize = mqueue.qsize()
        mqueue.queue.clear()
        return qsize
756298
private void purgeQueue(Queue queue, Session session) throws JMSException {
        purgeDestination(queue, session, queue.getQueueName());
    }
504752
def reset_everything(self, payload):
        """"""
        kill_signal = signals['9']
        self.process_handler.kill_all(kill_signal, True)
        self.process_handler.wait_for_finish()
        self.reset = True

        answer = {'message': 'Resetting current queue', 'status': 'success'}
        return answer
1262589
public void clear () {
		for (int i = 0; i < size; i++)
			queue[i] = null;
		size = 0;
		set.clear();
	}
1358725
function clear_messages()
    {
        $this->last_error = null;
        $this->last_error_id = null;
        $this->last_query = null;
    }
1000039
public static void killAll()
  {
    Collection<TaskQueue> taskQueues = new ArrayList<TaskQueue>( QUEUE_MAP.values() );
    for( TaskQueue taskQueue : taskQueues )
    {
      emptyAndRemoveQueue( taskQueue.getName() );
    }
  }
658138
def reset_queues(queues):
    """"""
    for queue in queues:
        with queue.mutex:
            queue._put = queue._pebble_old_method
        delattr(queue, '_pebble_old_method')
        delattr(queue, '_pebble_lock')
929536
def delete_queue(queues):
    """"""
    current_queues.delete(queues=queues)
    click.secho(
        'Queues {} have been deleted.'.format(
            queues or current_queues.queues.keys()),
        fg='green'
    )
604044
def cleanup(self):
        """"""
        self.num_puts = 0
        cached = []
        for i, url_data in enumerate(self.queue):
            key = url_data.cache_url
            cache = url_data.aggregate.result_cache
            if cache.has_result(key):
                cached.append(i)
        for pos in cached:
            self._move_to_top(pos)
1222778
public void clear() {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            int k = count;
            if (k > 0) {
                final Object[] items = this.items;
                final int putIndex = this.putIndex;
                int i = takeIndex;
                do {
                    items[i] = null;
                    if (++i == items.length) i = 0;
                } while (i != putIndex);
                takeIndex = putIndex;
                count = 0;
                if (itrs != null)
                    itrs.queueIsEmpty();
                for (; k > 0 && lock.hasWaiters(notFull); k--)
                    notFull.signal();
            }
        } finally {
            lock.unlock();
        }
    }
977212
def purge(self):
        
        self.sender.send_QueuePurge(self.name)
        yield from self.synchroniser.wait(spec.QueuePurgeOK)
        self.reader.ready()
12061
private static void purgeQueue() {

        ChronoReference cref;

        while ((cref = (ChronoReference) QUEUE.poll()) != null) {
            for (ChronoReference test : CHRONOS) {
                if (test.name.equals(cref.name)) {
                    CHRONOS.remove(test);
                    break;
                }
            }
        }

    }
1221136
def purge(self):
        
        while not self.stopped.isSet():
            self.stopped.wait(timeout=defines.EXCHANGE_LIFETIME)
            self._messageLayer.purge()
96131
async def clear_queue(self):
        """"""
        conn = await self._make_connection()
        try:
            script = """
                local keys = redis.call('KEYS', ARGV[1])
                redis.call('DEL', unpack(keys))
            """
            await conn.eval(
                script,
                keys=[],
                args=['*{}*'.format(settings.FLOW_MANAGER['REDIS_PREFIX'])],
            )
        finally:
            conn.close()