code: function(fn, context){
        // add function to queue
        queue.push({
          fn: fn,
          context: context
        });
  
        // set timer to process queue, if timer is not set yet
        if (!timer)
          timer = setImmediate(process);
  
        return true;
      }
docs: Invoke function as soon as possible. The ideal case is invocation in the end
  of current code frame (after all changes done). It's possible when code frame
  inited by browser events or timers (setImmediate/clearImmediate/nextTick), so
  we can process asap functions right after handler function was invoked.
  Asap function invocation can't be aborted.
  
  Single timer is using for asap functions invocation. Exceptions aren't catching.
  If any exception rest functions will be invoked in next code frame.
  
  @param {function} fn Function that should be invoked ASAP.
  @param {*=} context Context for function invocation.