highly destructive method!
 WARNING! Will delete the queue and all messages in it
17794
def destroy!
      unsubscribe  # first thing, make sure we don't get any callbacks related to this
      children = @zk.children(full_queue_path)
      locks = []
      children.each do |path|
        lock = @zk.locker("#{full_queue_path}/#{path}")
        lock.lock!    # XXX(slyphon): should this be a blocking lock?
        locks << lock
      end
      children.each do |path|
        begin
          @zk.delete("#{full_queue_path}/#{path}") 
        rescue ZK::Exceptions::NoNode
        end
      end

      begin
        @zk.delete(full_queue_path) 
      rescue ZK::Exceptions::NoNode
      end

      locks.each do |lock|
        lock.unlock!
      end
    end
1010413
def discard_incoming_messages(self):
        
        # Flush any received message so far.
        self.inbox.clear()

        # This allows nesting of discard_incoming_messages() calls.
        previous = self._discard_incoming_messages
        self._discard_incoming_messages = True

        try:
            yield
        finally:
            self._discard_incoming_messages = previous
1081455
def clear(self):
        
        logger.debug('Clearing queue: "%s"', self.name)
        return self.redis.delete(self.name)
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()
862550
@Override
    public void cleanup()
    {
        super.cleanup();
        MinecraftForge.EVENT_BUS.unregister(this);
        structureHasBeenCompleted = false;
        MalmoMod.MalmoMessageHandler.deregisterForMessage(this, MalmoMessageType.SERVER_MISSIONOVER);
    }
1276405
private void purgeQueue(String queueName, Session session) throws JMSException {
        purgeDestination(getDestination(session, queueName), session, queueName);
    }
1264932
def destroy(self):
        

        if getattr(self, 'publisher', None):
            self.log.debug("closing fedmsg publisher")
            self.log.debug("sent %i messages" % self._i)
            self.publisher.close()
            self.publisher = None

        if getattr(self, 'context', None):
            self.context.term()
            self.context = None
27140
public boolean remove() {
        Entry e = flushedEntry;
        if (e == null) {
            clearNioBuffers();
            return false;
        }
        Object msg = e.msg;

        ChannelPromise promise = e.promise;
        int size = e.pendingSize;

        removeEntry(e);

        if (!e.cancelled) {
            // only release message, notify and decrement if it was not canceled before.
            ReferenceCountUtil.safeRelease(msg);
            safeSuccess(promise);
            decrementPendingOutboundBytes(size, false, true);
        }

        // recycle the entry
        e.recycle();

        return true;
    }
579642
def destroy
      result = resource_get.destroy
      call_hook :after_destroy, result
      flash[:notice] = t 'messages.record_destroyed', model: t("models.#{resource_name}")

      respond_to do |wants|
        wants.html { redirect_to(resources_path) }
        wants.json  { head :ok }
      end
    end
756298
private void purgeQueue(Queue queue, Session session) throws JMSException {
        purgeDestination(queue, session, queue.getQueueName());
    }
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)
234727
def clear(self):
        """"""
        url = "queues/%s/messages" % self.name
        result = self.client.delete(url = url,
                                    body = json.dumps({}),
                                    headers={'Content-Type': 'application/json'})

        return result['body']
1361710
def delete(options = {})
      options = options.merge(
        queue_url: @queue_url,
        receipt_handle: @receipt_handle
      )
      resp = @client.delete_message(options)
      resp.data
    end
1287747
def delete(key)
      key = key.to_sym
      types.delete(key)
      messages.delete(key)
    end
1208253
function purge() {
    qLog.info(`Purging queue ${channelName} - ${connectionName}`);
    return channel.purgeQueue(channelName).then(function(){
      qLog.debug(`Successfully purged queue ${channelName} - ${connectionName}`);
    });
  }
1015369
def delete_message(message_title)
      full_path = "#{full_queue_path}/#{message_title}"
      locker = @zk.locker("#{full_queue_path}/#{message_title}")
      if locker.lock!
        begin
          @zk.delete(full_path)
          return true
        ensure
          locker.unlock!
        end
      else
        return false
      end
    end
1260127
def _cleanup(self):
        '''
        
        '''
        self._declare_cb = None
        self._bind_cb = None
        self._unbind_cb = None
        self._delete_cb = None
        self._purge_cb = None
        super(QueueClass, self)._cleanup()