B2G/gecko/services/aitc/modules/manager.js
/**
   * Local app was just installed or uninstalled, ask client to PUT if user
   * is logged in.
   */
Local app was just installed or uninstalled, ask client to PUT if user
is logged in.
Local app was just installed or uninstalled ask client to PUT if user is logged in .
function appEvent(type, app) {
    let self = this;
    let obj = {type: type, app: app, retries: 0, lastTime: 0};
    this._pending.enqueue(obj, function _enqueued(err, rec) {
      if (err) {
        self._log.error("Could not add " + type + " " + app + " to queue");
        return;
      }
      if (self._client) {
        self._processQueue();
        return;
      }
      self._makeClient(function(err, client) {
        if (!err && client) {
          self._client = client;
          self._processQueue();
        }
      });
    });
  }
function appEvent ( type , app ) { let self = this ; let obj = { type : type , app : app , retries : 0 , lastTime : 0 } ; this . _pending . enqueue ( obj , function _enqueued ( err , rec ) { if ( err ) { self . _log . error ( "Could not add " + type + " " + app + " to queue" ) ; return ; } if ( self . _client ) { self . _processQueue ( ) ; return ; } self . _makeClient ( function ( err , client ) { if ( ! err && client ) { self . _client = client ; self . _processQueue ( ) ; } } ) ; } ) ; }
Local app was just installed or uninstalled, ask client to PUT if user
 is logged in.
Local app was just installed or uninstalled ask client to PUT if user is logged in .
// Add this to the equeue. // If we already have a client (i.e. user is logged in), attempt to PUT. // If not, try a silent client creation. // If user is not logged in, we'll just have to try later.