// Purge the queue, removing all elements.
961582
func (s *SQS) Purge() error {

	params := &sqs.PurgeQueueInput{
		QueueUrl: s.queueURL,
	}
	_, err := s.client().PurgeQueue(params)
	return err
}
1041737
func (i *Image) cleanupAll() {
	i.cleanup()
	err := os.Remove(i.FilePath)
	if err != nil {
		logger.Debugf("got %q removing %q", err.Error(), i.FilePath)
	}
}
1329123
func (d *requestDistributor) remove(r *distReq) {
	r.sentChn = nil
	if r.element != nil {
		d.reqQueue.Remove(r.element)
		r.element = nil
	}
}
132473
func (a *Agent) purgeService(serviceID string) error {
	svcPath := filepath.Join(a.config.DataDir, servicesDir, stringHash(serviceID))
	if _, err := os.Stat(svcPath); err == nil {
		return os.Remove(svcPath)
	}
	return nil
}
1230877
func (ed *Execution_Data) PurgeTimestamps() {
	if ed == nil {
		return
	}
	ed.Created = nil
	ed.Modified = nil
}
839822
func (c *LFUCache) Purge() {
	c.mu.Lock()
	defer c.mu.Unlock()

	if c.purgeVisitorFunc != nil {
		for key, item := range c.items {
			c.purgeVisitorFunc(key, item.value)
		}
	}

	c.init()
}
770410
func (slist *syncedList) Remove(e *list.Element) interface{} {
	slist.Lock()
	defer slist.Unlock()

	return slist.queue.Remove(e)
}
495133
func (q *Queue) Remove() interface{} {
	if q.count <= 0 {
		panic("queue: Remove() called on empty queue")
	}
	ret := q.buf[q.head]
	q.buf[q.head] = nil
	// bitwise modulus
	q.head = (q.head + 1) & (len(q.buf) - 1)
	q.count--
	// Resize down if buffer 1/4 full.
	if len(q.buf) > minQueueLen && (q.count<<2) == len(q.buf) {
		q.resize()
	}
	return ret
}
251796
func (pq *PriorityQueue) Dispose() {
	pq.lock.Lock()
	defer pq.lock.Unlock()

	pq.disposeLock.Lock()
	defer pq.disposeLock.Unlock()

	pq.disposed = true
	for _, waiter := range pq.waiters {
		waiter.response.Add(1)
		waiter.ready <- true
	}

	pq.items = nil
	pq.waiters = nil
}
198431
func (b *Backend) PurgeGroupMeta(groupUUID string) error {
	_, err := b.groupMetasCollection.DeleteOne(context.Background(), bson.M{"_id": groupUUID})
	return err
}
43181
func (queue *Queue) Delete() error {
	consumers, err := queue.getConsumers()
	if err != nil {
		return err
	}

	for _, name := range consumers {
		if queue.isActiveConsumer(name) {
			return fmt.Errorf("cannot delete queue with active consumers")
		}

		consumer, err := queue.AddConsumer(name)
		if err != nil {
			return err
		}

		err = consumer.ResetWorking()
		if err != nil {
			return err
		}

		err = queue.redisClient.SRem(queueWorkersKey(queue.Name), name).Err()
		if err != nil {
			return err
		}
	}

	err = queue.ResetInput()
	if err != nil {
		return err
	}

	err = queue.ResetFailed()
	if err != nil {
		return err
	}

	err = queue.redisClient.SRem(masterQueueKey(), queue.Name).Err()
	if err != nil {
		return err
	}
	err = queue.redisClient.Del(queueWorkersKey(queue.Name)).Err()
	if err != nil {
		return err
	}

	queue.redisClient.Close()

	return nil
}
952696
func (slist *syncedList) Clear() {
	slist.Lock()
	defer slist.Unlock()

	slist.queue.Init()
}
391075
func (b *Backend) PurgeGroupMeta(groupUUID string) error {
	_, ok := b.groups[groupUUID]
	if !ok {
		return NewErrGroupNotFound(groupUUID)
	}

	delete(b.groups, groupUUID)
	return nil
}
1228779
func (pq *PrefixQueue) Drop() error {
	if err := pq.Close(); err != nil {
		return err
	}

	return os.RemoveAll(pq.DataDir)
}
1132926
func DeletePurge(purge bool) DeleteOption {
	return func(opts *options) {
		opts.uninstallReq.Purge = purge
	}
}
900817
func (p *PriorityQueue) Pop() (interface{}, error) {
	if len(*p.itemHeap) == 0 {
		return nil, errors.New("empty queue")
	}

	item := heap.Pop(p.itemHeap).(*item)
	delete(p.lookup, item.value)
	return item.value, nil
}
1218284
func (t *TSCache) Purge() {
	t.mux.Lock()
	defer t.mux.Unlock()
	n := 0
	for k, v := range t.table {
		if time.Now().Sub(v) > t.ttl {
			delete(t.table, k)
			n++
		}
	}
	log.Printf("D! [inputs.vsphere] Purged timestamp cache. %d deleted with %d remaining", n, len(t.table))
}