@function stop

stop app

@returns {Promise}
549086
async function stop () {
    return new Promise(function (resolve, reject) {
        // if not server then resolve
        if (!immutableApp || !immutableApp.server || !immutableApp.started) {
            resolve()
        }
        // close server
        immutableApp.server.close(function (err) {
            if (err) {
                reject(err)
            }
            else {
                // clear server
                immutableApp.server = undefined
                immutableApp.started = false
                // resolve
                resolve()
            }
        })
    })
}
1018887
function end () {
      sent = true;
      // next tick it to avoid express catching runtime error in the callback
      //   getting caught by express and triggering app's error handler
      process.nextTick(function () {
        res.emit('finish');
        cb(null, res);
      });
    }
525008
function stopRelay(cb) {
        var self = this;

        if (!this.control && !this.process) {
            return cb();
        }

        this.control.signalShutdown(function (err) {
            if (err) {
                return cb(err);
            }
            self.process.on('exit', function () {
                /**
                 * @callback TorRelay~stopCallback
                 * @param {null| error} error - Error if there was one
                 */
                return cb();
            });
        });
        return this;
    }
1043425
function stop() {
  var donePromise = mediator.promise(resultSyncSubscribers.getTopic(CONSTANTS.TOPICS.STOP, CONSTANTS.DONE_PREFIX));

  var errorPromise = mediator.promise(resultSyncSubscribers.getTopic(CONSTANTS.TOPICS.STOP, CONSTANTS.ERROR_PREFIX));

  mediator.publish(resultSyncSubscribers.getTopic(CONSTANTS.TOPICS.STOP));

  return getTopicPromises(donePromise, errorPromise);
}
333110
def stop(self):
        
        if not self.active:
            return
        self.removeHandler(self.handlers[-1])
        self.active = False
        return
561291
public function stopApplication() : void
    {
        if ($this->hasApplicationBeenStarted()) {
            foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
                call_user_func($callback);
            }

            $this->app->flush();
            $this->app = null;

            Facade::clearResolvedInstances();
            Facade::setFacadeApplication(null);
        }
    }
253623
function (options, callback) {
    if (this.stopAppServerFunc) {
      this.stopAppServerFunc(options, callback);
    } else if (this.appServer) {
      this.appServer.stop(callback);
    } else {
      callback();
    }
  }
1289004
function _flw_stop(reason, cb) {
      if (!cb && typeof reason === 'function') {
        cb = reason;
        reason = 'stopped';
      }
      c._stopped = reason;
      return cb();
    }
642163
function stopSeries(err) {
      if(err instanceof Error || (typeof err === 'object' && (err.code || err.error))) {
        stopErr = err;
      }
      isStopped = true;
    }
73565
function() {

    debug('shutting down...');

    var app = this;
    var server = this.server;

    if (!server) return Promise.resolve();

    return co.wrap(function* () {
      yield this.hookFor('shutdown');
    }).call(this).then(function() {
      server.close(function() { debug('goodbye!'); });
    });

  }
942299
def stop_app(self, callback_function_param=False):
        
        self.logger.info("Receiver:Stopping current app '%s'", self.app_id)
        return self.send_message(
            {MESSAGE_TYPE: 'STOP'},
            inc_session_id=True, callback_function=callback_function_param)
1027130
function stop(next) {
    if (phantomProcess) {
        seleniumServerProcess.on('close', function (code, signal) {
            // this should really resolve both callbacks rather than guessing phantom wrapper will terminate instantly
            if (typeof next === 'function' && !seleniumServerProcess ) {
                next();
            }
        });
        // SIGTERM should ensure processes end cleanly, can do killall -9 java if getting startup errors
        phantomProcess.kill('SIGTERM');
        started = false;
        starting = false;
    }
    if (seleniumServerProcess) {
        seleniumServerProcess.on('close', function (code, signal) {
            if (typeof next === 'function' ) {
                // need to stub out the other callback
                next();
            }
        });
        seleniumServerProcess.kill('SIGTERM');
        started = false;
        starting = false;
    }
}
228959
def app_stop(device_id, app_id):
    
    if not is_valid_app_id(app_id):
        abort(403)
    if not is_valid_device_id(device_id):
        abort(403)
    if device_id not in devices:
        abort(404)

    success = devices[device_id].stop_app(app_id)
    return jsonify(success=success)
56544
function stopWorker(worker){
    return new Promise(function(resolve, reject){
        // set kill timeout
        const killTimeout = setTimeout(() => {
            // kill the worker
            worker.kill();
            
            // failed to disconnect within given time
            reject(new Error(`process ${worker.process.pid} killed by timeout of ${_workerShutdownTimeout/1000}s - disconnect() failed`));
        }, _workerShutdownTimeout);

        // wait for exit + disconnect
        worker.on('disconnect', () => {
            _logger.log(`disconnect event ${worker.process.pid}`);
            // disable kill timer
            clearTimeout(killTimeout);

            // ok
            resolve();
        });

        // trigger disconnect
        worker.disconnect();
    });
}
968597
async function stopProxies() {
  if (proxies && proxies.length) {
    return Promise.all(proxies.map((proxy) => stop(proxy)));
  }

  return Promise.resolve();
}
297323
function stop(opts, done) {
  debug('stopping...');

  killIfRunning(opts, function(err) {
    debug('Any running workers have been sent a stop command');
    done(err);
  });
}
413080
def stop(*services, timeout: 10)
      o = opts(timeout: [timeout, 10])
      run!('stop', o, services)
    end