Adds an item to the queue.

        Uses polling if block=True, so there is no guarantee of order if
        multiple producers put to the same full queue.

        Raises:
            Full if the queue is full and blocking is False.
199783
def put(self, item, block=True, timeout=None):
        
        if self.maxsize <= 0:
            self.actor.put.remote(item)
        elif not block:
            if not ray.get(self.actor.put.remote(item)):
                raise Full
        elif timeout is None:
            # Polling
            # Use a not_full condition variable or promise?
            while not ray.get(self.actor.put.remote(item)):
                # Consider adding time.sleep here
                pass
        elif timeout < 0:
            raise ValueError("'timeout' must be a non-negative number")
        else:
            endtime = time.time() + timeout
            # Polling
            # Use a condition variable or switch to promise?
            success = False
            while not success and time.time() < endtime:
                success = ray.get(self.actor.put.remote(item))
            if not success:
                raise Full
17496
def add(self, session):
        
        self._items[session.session_id] = session

        if session.expiry is not None:
            heappush(self._queue, session)
1359508
def timeout_queue_add(self, item, cache_time=0):
        
        # add the info to the add queue.  We do this so that actually adding
        # the module is done in the core thread.
        self.timeout_add_queue.append((item, cache_time))
        # if the timeout_add_queue is not due to be processed until after this
        # update request is due then trigger an update now.
        if self.timeout_due is None or cache_time < self.timeout_due:
            self.update_request.set()
269709
def put(self, event, *args, **kwargs):
        
        self._queue.put((event, args, kwargs))
1324110
def append(self, item, select=False):
        
        if item in self:
            raise ValueError("item %s already in list" % item)
        modeliter = self.model.append((item,))
        self._id_to_iter[id(item)] = modeliter
        if select:
            self.selected_item = item
        self.emit('item-added', item)
1036195
def _add_to_stack(self, item, value):
        
        p_value = (item, value)
        if p_value not in self.stack:
            self.stack.append(p_value)
1360306
def append_waiting_queue(self, transfer_coordinator):
        '''  '''
        logger.debug("Add to waiting queue count=%d" % self.waiting_coordinator_count())
        with self._lockw:
            self._waiting_transfer_coordinators.append(transfer_coordinator)
1310615
def add(self, item):
        
        if isinstance(item, list):
            self.rows.append(Row(item))
        elif isinstance(item, Row):
            self.rows.append(item)
        else:
            raise InvalidMessageItemError(item, item.__class__)
759100
private void addToSplitterQueue(Block<S, L> block) {
        ElementReference ref = splitters.referencedAdd(block);
        block.setSplitterQueueReference(ref);
    }
657027
def add(self, item):
        
        check_not_none(item, "item can't be none")
        return self._encode_invoke(transactional_set_add_codec, item=self._to_data(item))
1072882
function addToQueue( callback, prioritize, seed ) {
	if ( prioritize ) {
		config.queue.splice( priorityCount++, 0, callback );
	} else if ( seed ) {
		if ( !unitSampler ) {
			unitSampler = unitSamplerGenerator( seed );
		}

		// Insert into a random position after all prioritized items
		const index = Math.floor( unitSampler() * ( config.queue.length - priorityCount + 1 ) );
		config.queue.splice( priorityCount + index, 0, callback );
	} else {
		config.queue.push( callback );
	}
}
841210
def sreenqueue(item_id, item_s, *args, **kwargs):
    '''
    '''
    return vsreenqueue(item_id, item_s, args, **kwargs)
839228
def addTag( self, tag ):
        
        if ( not (tag and self.isTagValid(tag)) ):
            return False
        
        self.blockSignals(True)
        create_item = self.createItem()
        if create_item:
            self.insertItem(self.row(create_item), XMultiTagItem(tag, self))
            create_item.setText('')
        else:
            self.addItem(XMultiTagItem(tag, self))
        self.blockSignals(False)
        
        if ( not self.signalsBlocked() ):
            self.tagCreated.emit(tag)
        
        return False
1093475
def notifyAppend(self, queue, force):
        '''
        
        '''
        if not force and not self.canAppend():
            self.isWaited = True
            return self._matcher
        if self.parent is not None:
            m = self.parent.notifyAppend(self, force)
            if m is not None:
                return m
        self.totalSize = self.totalSize + 1
        return None
1184404
def enqueue item, priority=0
      raise RangeError.new("priority #{priority} is greater than queue size") if priority > self.size
      @array.push PQNode.new(item, priority)
      @array.sort! { |a, b| a.priority <=> b.priority }
    end
931480
def add_request(self, request):
        

        queue_item = QueueItem(request, Response(request.url))
        self.add(queue_item)
        return queue_item
1294644
def append(self, item):
        
        self._deque.append(item)
        self.notEmpty.set()