Put the cooked data in the input queue (no locking needed)
329084
def inputcooker_store_queue(self, char):
        """"""
        if type(char) in [type(()), type([]), type("")]:
            for v in char:
                self.cookedq.put(v)
        else:
            self.cookedq.put(char)
1132405
def writecooked(self, text):
        """"""
        # Ensure this is the only thread writing
        self.OQUEUELOCK.acquire()
        TelnetHandlerBase.writecooked(self, text)
        self.OQUEUELOCK.release()
748391
def _flush_puts(self, items, options):
    """"""
    datastore.Put(items, config=self._create_config(options))
1049151
def put(self, data):
        
        self._to_put.append(data)

        if self.should_flush():
            self.flush()
255963
def flushInput(self):
                ''''''
                self.buf = ''
                saved_timeout = self.timeout
                self.timeout = 0.5
                self._recv()
                self.timeout = saved_timeout
                self.buf = ''
                self.debug("flushInput")
357254
private void flushData() {
    byte[] data = Arrays.copyOf(pendingBuffer, pendingLength);
    pendingLength = 0;
    handler.onData(data);
  }
553674
def _put (self, url_data):
        """"""
        if self.shutdown or self.max_allowed_urls == 0:
            return
        log.debug(LOG_CACHE, "queueing %s", url_data.url)
        key = url_data.cache_url
        cache = url_data.aggregate.result_cache
        if url_data.has_result or cache.has_result(key):
            self.queue.appendleft(url_data)
        else:
            assert key is not None, "no result for None key: %s" % url_data
            if self.max_allowed_urls is not None:
                self.max_allowed_urls -= 1
            self.num_puts += 1
            if self.num_puts >= NUM_PUTS_CLEANUP:
                self.cleanup()
            self.queue.append(url_data)
        self.unfinished_tasks += 1
1163493
function processQueue() {
        var queue = nextTick.queue;
        var digest = nextTick.digest;

        nextTick.queue = [];
        nextTick.timeout = null;
        nextTick.digest = false;

        queue.forEach(function(queueItem) {
          var skip = queueItem.scope && queueItem.scope.$$destroyed;
          if (!skip) {
            queueItem.callback();
          }
        });

        if (digest) $rootScope.$digest();
      }
1185466
def put_task(self, dp, callback=None):
        
        f = Future()
        if callback is not None:
            f.add_done_callback(callback)
        self.input_queue.put((dp, f))
        return f
860175
protected void putToRingBuffer(IQueueMessage<ID, DATA> msg) throws QueueException.QueueIsFull {
        if (msg == null) {
            throw new NullPointerException("Supplied queue message is null!");
        }
        LOCK_PUT.lock();
        try {
            if (!ringBuffer.tryPublishEvent((event, _seq) -> {
                event.set(msg);
                knownPublishedSeq = _seq > knownPublishedSeq ? _seq : knownPublishedSeq;
            })) {
                throw new QueueException.QueueIsFull(getRingSize());
            }
        } finally {
            LOCK_PUT.unlock();
        }
    }
1324729
protected void putToQueue(IQueueMessage<ID, DATA> msg) throws QueueException.QueueIsFull {
        if (!queue.offer(msg)) {
            throw new QueueException.QueueIsFull(getBoundary());
        }
    }
36656
private void _put(QueueData queueData, short msgBatch, boolean putOnEnd)
        {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "_put",
                                           new Object[]
                                           {
                                              queueData,
                                              ""+msgBatch,
                                              ""+putOnEnd
                                           });
      synchronized(this)
      {
         if (msgBatch == currentBatchNumber)
         {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Message is for correct batch");

            // Start D214620
            // First do a check to see if we should even bother trying to alter the HIGH_QUEUE_BYTES
            // If the alteration algorithm is switched off, or if we have already reached the max
            // then don't even bother
            if (HIGH_QUEUE_BYTES_THRESHOLD_FACTOR != 0 && HIGH_QUEUE_BYTES != HIGH_QUEUE_BYTES_MAX)
            {
               // Is this the first message back?
               if (bytesReceivedSinceLastRequestForMsgs == 0)
               {
                  // Work out how full the queue is in percent
                  float queueDepthPercent = (float) currentBytesOnQueue / (float) HIGH_QUEUE_BYTES;
                  int readableQueueDepthPercent = (int) queueDepthPercent * 100;

                  // If the queue is less full than we wanted it to be, make some adjustments
                  if (queueDepthPercent < HIGH_QUEUE_BYTES_THRESHOLD_FACTOR)
                  {
                     // Did the request come in the last 5 seconds?
                     long currentTime = System.currentTimeMillis();
                     if (currentTime < (lastRequestForMessagesTime + HIGH_QUEUE_BYTES_ALTERATION_TIMEOUT))
                     {
                        // Right to the queue is less than QUEUE_DEPTH_PERCENT_THRESHOLD% full
                        // Work out how many bytes more we needed to make it
                        // QUEUE_DEPTH_PERCENT_THRESHOLD% full and then increase the HIGH_QUEUE_BYTES
                        // by that amount
                        if (NEW_HIGH_QUEUE_BYTES == 0)
                        {
                           NEW_HIGH_QUEUE_BYTES = HIGH_QUEUE_BYTES;
                           NEW_LOW_QUEUE_BYTES = LOW_QUEUE_BYTES;
                        }

                        int old_HIGH_QUEUE_BYTES = NEW_HIGH_QUEUE_BYTES;
                        // First work out how bytes we want on the queue to be at the ideal level
                        int bytesPercent = (int) (HIGH_QUEUE_BYTES_THRESHOLD_FACTOR * NEW_HIGH_QUEUE_BYTES);
                        // And now add onto HIGH_QUEUE_BYTES how many bytes we need to make the actual
                        // queue level up to that value
                        NEW_HIGH_QUEUE_BYTES = NEW_HIGH_QUEUE_BYTES + (bytesPercent - (int) currentBytesOnQueue);
                        // Ensure the value is not too high
                        if (NEW_HIGH_QUEUE_BYTES > HIGH_QUEUE_BYTES_MAX)
                        {
                           NEW_HIGH_QUEUE_BYTES = HIGH_QUEUE_BYTES_MAX;
                        }
                        // And calculate the corresponding Low watermark
                        NEW_LOW_QUEUE_BYTES = (int) (NEW_HIGH_QUEUE_BYTES * LOW_QUEUE_FACTOR);

                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "HIGH_QUEUE_BYTES altered as Queue is " +
                                                             readableQueueDepthPercent + "% full (" +
                                                             currentBytesOnQueue + "/" +
                                                             old_HIGH_QUEUE_BYTES + ")");
                     }
                     else
                     {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Messages arrived outside the alteration timeout - no alteration made (Request made at: " + lastRequestForMessagesTime + ", now: " + currentTime);
                     }
                  }
                  else
                  {
                     if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Queue depth is fine - no need to alter (" + readableQueueDepthPercent + "% full)");
                  }
               }
            }

            // Messages are stored in reverse order in the linked list (i.e. the top of the queue
            // is the end of the list. So if we are adding onto the end of the queue, we place
            // it at the start of the list.
            synchronized(queue)
            {
            	if (putOnEnd)
            	{
            		queue.addFirst(queueData);
            	}
            	// Otheriwse add it to the end.
            	else
            	{
            		queue.addLast(queueData);
            	}
            }

            // If the data added to the queue was not a chunked message, then we have received an
            // entire message - so update counters etc
            if (!queueData.isChunkedMessage())
            {
               notifyMessageReceived(queueData);
            }
         }
         else
         {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Message is not being put as the batch number (" +
                                                 msgBatch + ") != current batch number (" + currentBatchNumber + ")");
         }
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Put complete. Queue is now: " + this);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "_put");
   }
211148
def _process_incoming_data(self):
        
        while self._running.is_set():
            if self.poller.is_ready:
                self.data_in += self._receive()
                self.data_in = self._on_read_impl(self.data_in)
53811
function queue(task, done) {
    var storage = this,
        key = this.keygen(task);

    // store task as JSON serialized string
    task = JSON.stringify(task);

    // first add the key to the queue
    this.redis().rpush(this.queueKey(), key, function(err) {
        if (err) done(err);

        // now store task data
        else storage.redis().set(key, task, function(err) {
            if (err) done(err);
            else done(null, key);
        });
    });
}
1236128
def feed(self, key_press):
        
        assert isinstance(key_press, KeyPress)
        self.input_queue.append(key_press)
923033
def put(self, item, block=True, timeout=None):
        """"""
        return self._queue.put(item, block, timeout)
119772
def feed(self, data):
        
        self._lock.acquire()
        try:
            if self._event is not None:
                self._event.set()
            self._buffer_frombytes(b(data))
            self._cv.notifyAll()
        finally:
            self._lock.release()