hash of queues to manage multiple requests
@property queues
@private
557442
function(id, loaded) {
        var q = queues[id], msg, w, d, h, n, url, s,
            insertBefore;

        if (q.timer) {
            // q.timer.cancel();
            clearTimeout(q.timer);
        }

        if (q.aborted) {
            msg = "transaction " + id + " was aborted";
            _fail(id, msg);
            return;
        }

        if (loaded) {
            q.url.shift(); 
            if (q.varName) {
                q.varName.shift(); 
            }
        } else {
            // This is the first pass: make sure the url is an array
            q.url = (L.isString(q.url)) ? [q.url] : q.url;
            if (q.varName) {
                q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName;
            }
        }

        w = q.win; 
        d = w.document; 
        h = d.getElementsByTagName("head")[0];

        if (q.url.length === 0) {
            _finish(id);
            return;
        } 

        url = q.url[0];

        // if the url is undefined, this is probably a trailing comma problem in IE
        if (!url) {
            q.url.shift(); 
            return _next(id);
        }


        if (q.timeout) {
            // q.timer = L.later(q.timeout, q, _timeout, id);
            q.timer = setTimeout(function() { 
                _timeout(id);
            }, q.timeout);
        }

        if (q.type === "script") {
            n = _scriptNode(url, w, q.attributes);
        } else {
            n = _linkNode(url, w, q.attributes);
        }

        // track this node's load progress
        _track(q.type, n, id, url, w, q.url.length);

        // add the node to the queue so we can return it to the user supplied callback
        q.nodes.push(n);

        // add it to the head or insert it before 'insertBefore'.  Work around IE
        // bug if there is a base tag.
        insertBefore = q.insertBefore || 
                       d.getElementsByTagName('base')[0];

        if (insertBefore) {
            s = _get(insertBefore, id);
            if (s) {
                s.parentNode.insertBefore(n, s);
            }
        } else {
            h.appendChild(n);
        }
        

        // FireFox does not support the onload event for link nodes, so there is
        // no way to make the css requests synchronous. This means that the css 
        // rules in multiple files could be applied out of order in this browser
        // if a later request returns before an earlier one.  Safari too.
        if ((ua.webkit || ua.gecko) && q.type === "css") {
            _next(id, url);
        }
    }
1258233
function(type, url, opts) {
        opts = opts || {};

        var id = "q" + (qidx++), q,
            thresh = opts.purgethreshold || Y.Get.PURGE_THRESH;

        if (qidx % thresh === 0) {
            _autoPurge();
        }

        queues[id] = Y.merge(opts, {
            tId: id,
            type: type,
            url: url,
            finished: false,
            nodes: []
        });

        q           = queues[id];
        q.win       = q.win || Y.config.win;
        q.context   = q.context || q;
        q.autopurge = ("autopurge" in q) ? q.autopurge : 
                      (type === "script") ? true : false;

        q.attributes = q.attributes || {};
        q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8';

        _next(id);

        return {
            tId: id
        };
    }
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);
        }
    }
901771
def queue(name = '', opts = {})
      queue = @connection.find_queue(name) || Queue.new(self, name, opts)
      @connection.register_queue queue
    end
1284010
function createQueue() {
    var queues = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        queues[_i] = arguments[_i];
    }
    var _queue;
    _queue = new GroupedQueue(chek_1.flatten(queues));
    return _queue;
}
448888
def dispatch_queue(self):
        
        self.queue_lock.acquire()
        q = list(self.queue)
        self.queue = []
        self.queue_lock.release()
        log.debug("Dispatching requests: {}".format(q))
        for req in q:
            req.response = self.dispatch_request(req)
        for req in q:
            req.signal()
1130972
function(){
		var copy = [];

		// Handle recursive loops
		if ( queue.running ) {
			queue.waiting = true;
			return;
		}

		// Mark queue as running, then search for 
		queue.running = true;
		munit.each( queue.modules, function( assert, index ) {
			if ( ! queue.objects.length ) {
				return false;
			}
			else if ( ! munit.render.checkDepency( assert ) ) {
				return;
			}

			// Looking for specific key in queue object
			if ( munit.isString( assert.options.queue ) ) {
				munit.each( queue.objects, function( object, i ) {
					if ( object[ assert.options.queue ] ) {
						queue.modules[ index ] = null;
						queue.objects.splice( i, 1 );
						assert.queue = object;
						assert.trigger();
						return false;
					}
				});
			}
			// Any queue will do
			else {
				queue.modules[ index ] = null;
				assert.queue = queue.objects.shift();
				assert.trigger();
			}
		});

		// Clean out modules that completed (splicing causes iteration fails)
		queue.modules.forEach(function( assert ) {
			if ( assert !== null ) {
				copy.push( assert );
			}
		});
		queue.modules = copy;

		// Run again if check method was called during loop
		queue.running = false;
		if ( queue.waiting ) {
			queue.waiting = false;
			queue.check();
		}
	}
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 = []
  }
652912
function _runFileQueue() {
  if (!settings) settings = require('./settings');
  const simultaneous = settings.get('load-simultaneously') || 10;

  if ((loading < simultaneous) && (fileQueue.length)) {
    loading++;
    fileQueue.shift()();
  }
}
537320
function() {
                if (hasCache) {
                    queueDb = new Dexie('podQueues');

                    queueDb.version(1)
                        .stores({
                            waitQ: '[owner+threadId+uniqueId], owner, threadId, uniqueId, message'
                        });

                    if (enableCache) {
                        db = new Dexie('podChat');

                        db.version(1)
                            .stores({
                                users: '&id, name, cellphoneNumber, keyId',
                                contacts: '[owner+id], id, owner, uniqueId, userId, cellphoneNumber, email, firstName, lastName, expireTime',
                                threads: '[owner+id] ,id, owner, title, time, [owner+time]',
                                participants: '[owner+id], id, owner, threadId, notSeenDuration, name, contactName, email, expireTime',
                                messages: '[owner+id], id, owner, threadId, time, [threadId+id], [threadId+owner+time]',
                                messageGaps: '[owner+id], [owner+waitsFor], id, waitsFor, owner, threadId, time, [threadId+owner+time]'
                            });

                        db.open()
                            .catch(function(e) {
                                console.log('Open failed: ' + e.stack);
                            });

                        db.on('ready', function() {
                            isCacheReady = true;
                        }, true);

                        db.on('versionchange', function(event) {
                            window.location.reload();
                        });
                    }
                }
                else {
                    console.log(CHAT_ERRORS[6600]);
                }
            }
841210
def sreenqueue(item_id, item_s, *args, **kwargs):
    '''
    '''
    return vsreenqueue(item_id, item_s, args, **kwargs)
1122643
function() {
        var queue = this._queue;
        for (var i = 0, len = queue.length; i < len; ++i) {
            this[queue[i][0]].apply(this, queue[i][1]);
        }
    }
1296651
function JobQueue(para) {
	this.queue = [];
	this.curr = 0;
	this.all_passed = true;
	this.timeout = ((typeof para === 'object' && typeof para.timeout === 'number') ? para.timeout : 0);
}
980215
function requestNextHashTree(ws) {
	db.query("SELECT COUNT(1) AS count_left FROM catchup_chain_balls", function (rows) {
		if (rows.length > 0) {
			if (catchup_balls_at_start == -1) { // first time to get all catchup ball number
				catchup_balls_at_start = rows[0].count_left;
			}
			catchup_balls_left = rows[0].count_left;
		}
	});
	db.query("SELECT ball FROM catchup_chain_balls ORDER BY member_index LIMIT 2", function (rows) {
		if (rows.length === 0)
			return comeOnline();
		if (rows.length === 1) {
			db.query("DELETE FROM catchup_chain_balls WHERE ball=?", [rows[0].ball], function () {
				comeOnline();
			});
			return;
		}

		let from_ball = rows[0].ball;
		let to_ball = rows[1].ball;

		// don't send duplicate requests
		for (let tag in ws.assocPendingRequests) {
			if (ws.assocPendingRequests[tag].request.command === 'get_hash_tree') {
				console.log("already requested hash tree from this peer");
				return;
			}
		}

		//	...
		sendRequest(ws, 'get_hash_tree', {from_ball: from_ball, to_ball: to_ball}, true, handleHashTree);
	});
}
248968
function enqueueTask(fn) {
  let id = nextTaskId++;
  let handle = null;
  pendingTasks[id] = () => {
    if (id in pendingTasks) {
      fn.apply(null, arguments);
      clearImmediate(handle);
      delete pendingTasks[id];
    }
  };
  handle = setImmediate(pendingTasks[id]);
}
254604
function sqPush(queue, index, count, item) {
  queue[count] = item
  index[item]  = count
}
932697
function AsyncQueue(tasks, fn) {
        // better compression for shrinking `this`
        var self = this;

        // TODO: exposing this is not safe
        self.tasks = [];
        self.callbacks = [];
        self.errors = [];

        // return values of Promise
        self.data = {};

        // resolved task index
        self.nextTask = 0;

        // resolved callback index
        self.nextCallback = 0;

        // -1 (default) means not waiting for AsyncQueue#then
        self.until = -1;

        // queue is executing callback
        self.digest = false;

        // add tasks and callbacks
        self.add(tasks).whenDone(fn);
    }