code: function enqueue(queueName, url){
  
    // fallback to first queue
    if (!queues[queueName]) {
      if (queueName) console.error('onknown queue ', queueName)
      queueName = queuesByPriority[0]
    }
  
    // create promise and add to queue
    return new Promise(function(resolve, reject){
      // has to be asynchronous in order to decouple queue processing from synchronous code
      setTimeout(function(){
        var queue = queues[queueName]
        queue[ queue.length ] = { url: url, start: resolve }
        processQueue()
      },1)
    })
  
  }
docs: public methods