Empty all the queued messages for an existing topic.
189715
def empty_topic(self, topic):
        """"""
        nsq.assert_valid_topic_name(topic)
        return self._request('POST', '/topic/empty', fields={'topic': topic})
573316
public boolean removeMessageListener(String topic, IKafkaMessageListener msgListener) {
        synchronized (topicMsgListeners) {
            if (topicMsgListeners.remove(topic, msgListener)) {
                if (topicMsgListeners.get(topic).isEmpty()) {
                    // no more listener, stop worker
                    KafkaMsgConsumerWorker worker = topicWorkers.remove(topic);
                    if (worker != null) {
                        worker.stopWorker();
                    }
                }
                return true;
            }
        }
        return false;
    }
774520
def flush_all(self):
        
        for queue_name in chain(self.queues, self.delay_queues):
            self.flush(queue_name)
566094
public int removeAllMessages(String queueName) {
        try {
            return getQueueControl(queueName).removeMessages(null);
        } catch (Exception e) {
            throw new AsyncException(e);
        }
    }
741696
def _unbind_topics(self, topics):
        

        self.client.unsubscribe(topics.status)
        self.client.unsubscribe(topics.tracing)
        self.client.unsubscribe(topics.streaming)
        self.client.unsubscribe(topics.response)
745265
def unpause_topic(self, topic):
        """"""
        nsq.assert_valid_topic_name(topic)
        return self._request('POST', '/topic/unpause', fields={'topic': topic})
581968
def disconnect_all(self, message=""):
        """"""
        with self.mutex:
            for conn in self.connections:
                conn.disconnect(message)
1196952
function (handle) {
        if (handle) {
            var topic = handle.topic, list = listeners[topic];
            if (list) {
                for (var i = list.length - 1; i >= 0; i--) {
                    if (list[i] === handle) {
                        list.splice(i, 1);
                    }
                }
                if (!list.length) {
                    delete listeners[topic];
                }
            }
        }
    }
183475
def clearReqVars(self):
        
        self.errorMsg = None
        self.payload = None
        self.url = None
        self.resp = None
        self.res = None
        self.method = None
        self.printErrors = None
1221136
def purge(self):
        
        while not self.stopped.isSet():
            self.stopped.wait(timeout=defines.EXCHANGE_LIFETIME)
            self._messageLayer.purge()
705652
def _clear_queue(to_clear):
    """"""

    while not to_clear.empty():
        try:
            to_clear.get(False)
            to_clear.task_done()
        except queue.Empty:
            continue
980432
def clear(self):
        """"""
        for key in list(self.queue.keys()):
            if self.queue[key]['status'] in ['done', 'failed']:
                del self.queue[key]
        self.write()
870729
public void free()
    {
        if (m_messageMap != null)
        {
            for (BaseMessageQueue messageQueue : m_messageMap.values())
            {
                if (messageQueue != null)
                {       // Don't worry about removing these, since you are removing them all.
                    messageQueue.setMessageManager(null);   // Make sure it doesn't try to remove itself again
                    messageQueue.free();
                }                
            }
        }
        m_messageMap = null;
        super.free();
    }
296941
public void clear() {
        weightParams.clear();
        biasParams.clear();
        paramsList = null;
        weightParamsList = null;
        biasParamsList = null;
    }
441631
async def stop_pages(self):
        """"""
        await self.bot.delete_message(self.message)
        self.paginating = False
1331327
public void clear() {
        modCount++;
        for (int i = 0; i < size; i++)
            queue[i] = null;
        size = 0;
    }
816758
def clear_messages(self, queue_name, timeout=None):
        '''
        
        '''
        _validate_not_none('queue_name', queue_name)
        request = HTTPRequest()
        request.method = 'DELETE'
        request.host = self._get_host()
        request.path = _get_path(queue_name, True)
        request.query = [('timeout', _int_to_str(timeout))]
        self._perform_request(request)