// Enqueue enqueues the given Tasks "ts".
490537
func (l *Logger) Enqueue(ts ...Task) {
	if l == nil {
		for _, t := range ts {
			if t == nil {
				// NOTE: Do not allow nil tasks which are unable
				// to be completed.
				continue
			}
			go func(t Task) {
				for range t.Updates() {
					// Discard all updates.
				}
			}(t)
		}
		return
	}

	l.wg.Add(len(ts))
	for _, t := range ts {
		if t == nil {
			// NOTE: See above.
			continue
		}
		l.queue <- t
	}
}
865173
func (b *Buffer) Enqueue(item interface{}) {
	b.rw.Lock()
	{
		b.buffer = append(b.buffer, item)
	}
	b.rw.Unlock()
}
756767
func (c *proxyConnection) Enqueue(msg []byte) {
	scopedLog := log.WithFields(logrus.Fields{
		fieldConn: c,
		fieldSize: len(msg),
	})

	flowdebug.Log(scopedLog, fmt.Sprintf("Enqueueing %s message", c.direction()))

	select {
	case <-c.close:
		flowdebug.Log(scopedLog, fmt.Sprintf("%s connection is closed; dropping message", c.direction()))
	case c.queue <- msg:
		flowdebug.Log(scopedLog, fmt.Sprintf("Enqueued %s message", c.direction()))
	}
}
606040
func NewQueue() (q *Queue) {
	initChunk := new(chunk)
	q = &Queue{
		head: initChunk,
		tail: initChunk,
	}
	return q
}
144216
func (s *Job) SetQueue(v string) *Job {
	s.Queue = &v
	return s
}
357863
func (s *SliceQueue) Dequeue() (interface{}, error) {
	if s.IsEmpty() {
		return nil, errors.New("unable to dequeue element, queue is empty")
	}

	item := s.backing[0]
	// https://github.com/golang/go/wiki/SliceTricks
	s.backing = append(s.backing[:0], s.backing[1:]...)
	s.size--
	return item, nil
}
828812
func (w *watchQueue) Enqueue(update *watchUpdate) {
	w.m.Lock()
	w.updates = append(w.updates, update)
	w.cv.Signal()
	w.m.Unlock()
}
786193
func (rkq *RekeyQueueStandard) Enqueue(id tlf.ID) {
	rkq.mu.Lock()
	defer rkq.mu.Unlock()
	rkq.pendings[id] = true

	select {
	case rkq.queue <- id:
	default:
		// The queue is full; drop this one for now until the next
		// request to the server for more rekeys.
		rkq.log.Debug("Rekey queue is full; dropping %s", id)
	}
}
68033
func (s *UpdateJobTemplateInput) SetQueue(v string) *UpdateJobTemplateInput {
	s.Queue = &v
	return s
}
1041042
func (t *taskQueue) worker() {
	for {
		key, quit := t.queue.Get()
		if quit {
			close(t.workerDone)
			return
		}
		glog.V(3).Infof("syncing %v", key)
		if err := t.sync(key.(string)); err != nil {
			glog.V(3).Infof("requeuing %v, err %v", key, err)
			t.requeue(key.(string))
		} else {
			t.queue.Forget(key)
		}

		t.queue.Done(key)
	}
}
233087
func (daemon *Daemon) enqueueIngressJob(job *ingressJob) {
	ingressWorkerOnce.Do(daemon.startIngressWorker)
	ingressJobsChannel <- job
}
338307
func (c *Controller) enqueueFoo(obj interface{}) {
	var key string
	var err error
	if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil {
		utilruntime.HandleError(err)
		return
	}
	c.workqueue.Add(key)
}
141902
func (c *UnidlingController) enqueueEvent(event *corev1.Event) {
	if event.Reason != unidlingapi.NeedPodsReason {
		return
	}

	info := types.NamespacedName{
		Namespace: event.InvolvedObject.Namespace,
		Name:      event.InvolvedObject.Name,
	}

	// only add things to the queue if they're newer than what we already have
	if c.lastFiredCache.AddIfNewer(info, event.LastTimestamp.Time) {
		c.queue.Add(info)
	}
}
214431
func (pq *PrefixQueue) Enqueue(prefix, value []byte) (*Item, error) {
	pq.Lock()
	defer pq.Unlock()

	// Check if queue is closed.
	if !pq.isOpen {
		return nil, ErrDBClosed
	}

	// Get the queue for this prefix.
	q, err := pq.getOrCreateQueue(prefix)
	if err != nil {
		return nil, err
	}

	// Create new Item.
	item := &Item{
		ID:    q.Tail + 1,
		Key:   generateKeyPrefixID(prefix, q.Tail+1),
		Value: value,
	}

	// Add it to the queue.
	if err := pq.db.Put(item.Key, item.Value, nil); err != nil {
		return nil, err
	}

	// Increment tail position and prefix queue size.
	q.Tail++
	pq.size++

	// Save the queue.
	if err := pq.saveQueue(prefix, q); err != nil {
		return nil, err
	}

	// Save main prefix queue data.
	if err := pq.save(); err != nil {
		return nil, err
	}

	return item, nil
}
17383
func (s *CreateQueueOutput) SetQueue(v *Queue) *CreateQueueOutput {
	s.Queue = v
	return s
}
993083
func (q *Queue) EnqueueString(value string) (*Item, error) {
	return q.Enqueue([]byte(value))
}
364346
func (s *CreateJobTemplateInput) SetQueue(v string) *CreateJobTemplateInput {
	s.Queue = &v
	return s
}