hash of queues to manage multiple requests
@property queues
@private
434500
function(type, attr, win) {
        var w = win || Y.config.win, d=w.document, n=d.createElement(type),
            i;

        for (i in attr) {
            if (attr[i] && attr.hasOwnProperty(i)) {
                n.setAttribute(i, attr[i]);
            }
        }

        return n;
    }
128040
function(id, msg, result) {
        var q = queues[id], sc;
        if (q && q.onEnd) {
            sc = q.context || q;
            q.onEnd.call(sc, _returnData(q, msg, result));
        }
    }
1010365
function done() {
        var index = queue.length;

        while (index--) {
            patch(queue[index], one(queue[index]));
        }
    }
603905
function(queueName, target, method) {
    var queues = this._queues, queue;
    if (!queues) { queues = this._queues = {}; }
    queue = queues[queueName];
    if (!queue) { queue = queues[queueName] = []; }

    var args = arguments.length > 3 ? slice.call(arguments, 3) : null;
    queue.push({ target: target, method: method, args: args });
    return this;
  }
1153018
function dequeue(id) {
        var i = qq.indexOf(queue, id),
            max = options.maxConnections,
            nextId;

        delete requestData[id];
        queue.splice(i, 1);

        if (queue.length >= max && i < max) {
            nextId = queue[max - 1];
            sendRequest(nextId);
        }
    }
258935
function (options) {
    this.queue = [];
    this.ownerTokenId = null;
    this.options = _.extend({}, AsyncLock.defaultOptions, options);
}
476310
function Queue(options) {
  var self = this;

  typeforce({
    path: 'String',
    process: 'Function',
    throttle: 'Number',
    leveldown: 'Function'
  }, options);

  EventEmitter.call(this);

  this._options = extend(true, {}, options);
  this._process = options.process;
  this._throttle = options.throttle;
  this._strikes = ('strikes' in options) ? options.strikes : false;
  this._blockOnFail = options.blockOnFail;

  this._q = [];
  this._db = levelQuery(levelup(options.path, {
    db: options.leveldown,
    valueEncoding: 'json'
  }));

  this._db.query.use(jsonQueryEngine());

  indices.forEach(function(i) {
    self._db.ensureIndex(i);
  });

  this._deleting = {};
  promisifyDB(this._db);
  promisifyDB(this._db, 'query', { type: 'readable' })

  this._setupCount();
  this._load()
    .then(function() {
      if (options.autostart) self.start();
    });
}
463126
function nextTick() {
  draining = true;
  var i, oldQueue;
  var len = queue.length;
  while (len) {
    oldQueue = queue;
    queue = [];
    i = -1;
    while (++i < len) {
      oldQueue[i]();
    }
    len = queue.length;
  }
  draining = false;
}
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();
      }
1024729
def put(key, data)
      queue = queues(key)
      return nil unless queue

      @stats[:current_bytes] += data.size
      @stats[:total_items] += 1

      queue.push(data)

      return true
    end
187643
function queue(steps) {
  var swal = this;
  currentSteps = steps;

  var resetQueue = function resetQueue() {
    currentSteps = [];
    document.body.removeAttribute('data-swal2-queue-step');
  };

  var queueResult = [];
  return new Promise(function (resolve) {
    (function step(i, callback) {
      if (i < currentSteps.length) {
        document.body.setAttribute('data-swal2-queue-step', i);
        swal(currentSteps[i]).then(function (result) {
          if (typeof result.value !== 'undefined') {
            queueResult.push(result.value);
            step(i + 1, callback);
          } else {
            resetQueue();
            resolve({
              dismiss: result.dismiss
            });
          }
        });
      } else {
        resetQueue();
        resolve({
          value: queueResult
        });
      }
    })(0);
  });
}
616584
def all(cls):
        

        # Start with raw queues we know exist from the config
        queues = {x: 0 for x in Queue.get_queues_config()}

        stats = list(context.connections.mongodb_jobs.mrq_jobs.aggregate([
            {"$match": {"status": "queued"}},
            {"$group": {"_id": "$queue", "jobs": {"$sum": 1}}}
        ]))

        queues.update({x["_id"]: x["jobs"] for x in stats})

        return queues
492233
function dequeue(queue, item) {
    queue[SIZE] -= 1

    let done = false
    item.action(() => {
        if (done) {
            return
        }
        done = true

        if (item.next) {
            dequeue(queue, item.next)
        }
        else {
            assert(queue[TAIL] === item, "BROKEN")
            queue[TAIL] = null
        }
    })
}
204321
function (benchmark, simultaneousRequests, done) {
	var pageName,
		engineName;

	this.benchmark = benchmark;
	this.simultaneousRequests = simultaneousRequests;
	this.done = done;

	if (typeof simultaneousRequests !== "number") {
		throw new Error("simultaneousRequests must be an integer; " + (typeof simultaneousRequests) + " passed");
	}
	if (simultaneousRequests < 1) {
		throw new Error("simultaneousRequests must be at least 1; " + simultaneousRequests + " passed");
	}

	this.responseTimes = {};
	for (pageName in this.benchmark.pages) {
		this.responseTimes[pageName] = {};
		for (engineName in this.benchmark.engines) {
			this.responseTimes[pageName][engineName] = [];
		}
	}

	this.totals = {};
}
784349
def queues(key=nil)
      return nil if @shutdown_mutex.locked?

      return @queues if key.nil?

      # First try to return the queue named 'key' if it's available.
      return @queues[key] if @queues[key]

      # If the queue wasn't available, create or get the mutex that will
      # wrap creation of the Queue.
      @queue_init_mutexes[key] ||= Mutex.new

      # Otherwise, check to see if another process is already loading
      # the queue named 'key'.
      if @queue_init_mutexes[key].locked?
        # return an empty/false result if we're waiting for the queue
        # to be loaded and we're not the first process to request the queue
        return nil
      else
        begin
          @queue_init_mutexes[key].lock
          # we've locked the mutex, but only go ahead if the queue hasn't
          # been loaded. There's a race condition otherwise, and we could
          # end up loading the queue multiple times.
          if @queues[key].nil?
            @queues[key] = PersistentQueue.new(@path, key)
            @stats[:current_bytes] += @queues[key].initial_bytes
          end
        rescue Object => exc
          puts "ZOMG There was an exception reading back the queue. That totally sucks."
          puts "The exception was: #{exc}. Backtrace: #{exc.backtrace.join("\n")}"
        ensure
          @queue_init_mutexes[key].unlock
        end
      end

      return @queues[key]
    end
658138
def reset_queues(queues):
    """"""
    for queue in queues:
        with queue.mutex:
            queue._put = queue._pebble_old_method
        delattr(queue, '_pebble_old_method')
        delattr(queue, '_pebble_lock')
1193264
def fetch(*queues)
      job = nil
      transaction do
        command("FETCH", *queues)
        job = result!
      end
      JSON.parse(job) if job
    end