queue : QUEUE COLON LIFO
          | QUEUE COLON FIFO
545930
def p_queue(p):
    
    if p[3] == "LIFO":
        p[0] = {"queue": LIFO()}

    elif p[3] == "FIFO":
        p[0] = {"queue": FIFO()}

    else:
        raise RuntimeError("Queue discipline '%s' is not supported!" % p[1])
983004
def list_queues(backend='sqlite'):
    '''
    
    '''
    queue_funcs = salt.loader.queues(__opts__)
    cmd = '{0}.list_queues'.format(backend)
    if cmd not in queue_funcs:
        raise SaltInvocationError('Function "{0}" is not available'.format(cmd))
    ret = queue_funcs[cmd]()
    return ret
121635
def vsenqueue(trg_queue, item_s, args, **kwargs):
    '''
    '''
    charset = kwargs.get('charset', _c.FSQ_CHARSET)
    if kwargs.has_key('charset'):
        del kwargs['charset']

    # we coerce here because StringIO.StringIO will coerce on file-write,
    # and cStringIO.StringIO has a bug which injects NULs for unicode
    if isinstance(item_s, unicode):
        try:
            item_s = item_s.encode(charset)
        except UnicodeEncodeError:
            raise FSQCoerceError(errno.EINVAL, u'cannot encode item with'\
                                 u' charset {0}'.format(charset))

    return venqueue(trg_queue, StringIO(item_s), args, **kwargs)
41550
def escape_queue(s):
    
    if isinstance(s, PosixPath):
        s = unicode_(s)
    elif isinstance(s, bytes):
        s = s.decode('utf-8')
    if s.startswith('~/'):
        return '~/' + shell_escape(s[2:])
    else:
        return shell_escape(s)
728651
def queue_declare(self, queue, durable, exclusive, auto_delete,
            warn_if_exists=False, arguments=None):
        """"""

        return self.channel.queue_declare(queue=queue,
                                          durable=durable,
                                          exclusive=exclusive,
                                          auto_delete=auto_delete,
                                          arguments=arguments)
133819
function Queue(parameters) {
    parameters = parameters || new composites.Parameters(new Catalog());
    if (!parameters.getParameter('$type')) parameters.setParameter('$type', '/bali/collections/Queue/v1');
    abstractions.Collection.call(this, utilities.types.QUEUE, parameters);

    // the capacity and array are private attributes so methods that use it are
    // defined in the constructor
    var capacity = 1024;  // default capacity
    if (parameters) {
        const value = parameters.getParameter('$capacity', 2);
        if (value) capacity = value.toNumber();
    }
    const array = [];

    this.acceptVisitor = function(visitor) {
        visitor.visitQueue(this);
    };

    this.toArray = function() {
        return array.slice();  // copy the array
    };

    this.getSize = function() {
        return array.length;
    };

    this.addItem = function(item) {
        if (array.length < capacity) {
            item = this.convert(item);
            array.push(item);
            return true;
        }
        throw new utilities.Exception({
            $module: '/bali/collections/Queue',
            $procedure: '$addItem',
            $exception: '$resourceLimit',
            $capacity: capacity,
            $text: '"The queue has reached its maximum capacity."'
        });
    };

    this.removeItem = function() {
        if (array.length > 0) return array.splice(0, 1)[0];  // remove the first item in the array
    };

    this.getHead = function() {
        return array[0];
    };

    this.deleteAll = function() {
        array.splice(0);
    };

    return this;
}
1122975
function construct(err, dictionary) {
    var length = queue.length
    var index = -1

    loadError = err

    if (dictionary) {
      config.checker = nspell(dictionary)

      if (personal) {
        config.checker.personal(personal)
      }
    }

    while (++index < length) {
      if (!err) {
        all.apply(null, queue[index])
      }

      queue[index][3](err)
    }

    queue = []
  }
251666
function nextTick() {
  if (draining) {
    return;
  }
  scheduled = false;
  draining = true;
  var len = queue.length;
  var timeout = setTimeout(cleanUpNextTick);
  while (len) {
    currentQueue = queue;
    queue = [];
    while (currentQueue && ++queueIndex < len) {
      currentQueue[queueIndex].run();
    }
    queueIndex = -1;
    len = queue.length;
  }
  currentQueue = null;
  queueIndex = -1;
  draining = false;
  clearTimeout(timeout);
}
200168
public void queueEntry(String entryPath, InputStream inStream,
                           int maxBytes)
                           throws IOException, TarMalformatException {
        entryQueue.add(new TarEntrySupplicant(entryPath, inStream, maxBytes,
                                              '0', archive));
    }
764724
def queue(name, arguments = {})
      with_bunny_precondition_handler('queue') do
        namespace = @config[:namespace].to_s.downcase.gsub(/[^-_:\.\w]/, "")
        name = name.prepend(namespace + ":") if namespace.present?
        channel.queue(name, durable: true, arguments: arguments)
      end
    end
873650
function Queue(queueName, accessKey, secretKey, region) {
  if (!(this instanceof Queue)) return new Queue(queueName, accessKey, secretKey, region);
  var self = this;
  Object.defineProperty(this, '_sqs',{enumerable: false, configurable: false, writable: false,
    value: getSQS(accessKey, secretKey, region)});
  function setQueue(name) {
    debug('set queue: ' + name);
    var parsed;
    if (parsed = /([0-9]{12}\/([^\/]+))\/?$/.exec(name)) {
      self._sqs.setQueue('/' + parsed[1] + '/');
      self.name = parsed[2];
      if (self._init) delete self._init;
    } else if (typeof name === 'string') {
      self.name = name;
      Object.defineProperty(self, '_init',{enumerable: false, configurable: true, writable: true,
        value: getQueueURL(self, name).then(setQueue)});
      self.then = self._init.then;
      self.done = self._init.done;
    } else if (name && typeof name === 'object' && typeof name.then === 'function') {
      self.name = name.toString();
      Object.defineProperty(self, '_init',{enumerable: false, configurable: true, writable: true,
        value: name.then(setQueue)});
      self.then = self._init.then;
      self.done = self._init.done;
    } else {
      throw new Error(JSON.stringify(name) + ' is not a valid queue.');
    }
  }
  setQueue(queueName);
}
254604
function sqPush(queue, index, count, item) {
  queue[count] = item
  index[item]  = count
}
1150356
def process(self, blob):
        """"""
        # self._add_process_dt()
        try:
            log.debug("Waiting for queue items.")
            prefix, data = self.queue.get(timeout=self.timeout)
            log.debug("Got {0} bytes from queue.".format(len(data)))
        except Empty:
            log.warning(
                "ControlHost timeout ({0}s) reached".format(self.timeout)
            )
            raise StopIteration("ControlHost timeout reached.")
        blob[self.key_for_prefix] = prefix
        blob[self.key_for_data] = data
        return blob
1041640
function(fn) {
				funcGuard(fn);
				if (completeQueue !== noop) {
					throw new Error('queue `then` already set');
				}
				if (!err) {
					completeQueue = fn;
					if (!remaining) {
						complete = true;
						completeQueue(tasks);
					}
				}
				return q;
			}
330251
public static function typed(string $type, iterable $input = []): Queue
    {
        $resolver = Resolver::typed($type);

        return new static($input, $resolver);
    }
749532
def _queue(self, kwargs):
    """"""
    if not 'hard resource_list' in kwargs: return 'all.q'
    d = dict([k.split('=') for k in kwargs['hard resource_list'].split(',')])
    for k in d:
      if k[0] == 'q' and d[k] == 'TRUE': return k
    return 'all.q'
54223
def _multi_lpop_pipeline(self, pipe, queue, number):
        ''' '''
        pipe.lrange(queue, 0, number - 1)
        pipe.ltrim(queue, number, -1)