Get the server status

@param {Function} callback
@return {ImboClient}
182514
function(callback) {
        request.get(this.getStatusUrl(), function(err, res, body) {
            if (err) {
                return callback(err);
            }

            body = body || {};
            body.status = res.statusCode;
            body.date = new Date(body.date);

            callback(err, body, res);
        });

        return this;
    }
991514
def get_current_status(self):
        """"""
        url = get_url("/remote/status.json")
        params = {"oauth": self._oauth_token, "csrf": self._csrf_token}
        r = self._request(url=url, params=params)
        return r.json()
302029
function (req, callback) {
    var params = req.body
    var clientId = params.client_id
    var clientSecret = params.client_secret

    // missing credentials
    if (!clientId || !clientSecret) {
      return callback(new AuthorizationError({
        error: 'unauthorized_client',
        error_description: 'Missing client credentials',
        statusCode: 400
      }))
    }

    Client.get(clientId, function (err, client) {
      if (err) { return callback(err) }

      // Unknown client
      if (!client) {
        return callback(new AuthorizationError({
          error: 'unauthorized_client',
          error_description: 'Unknown client identifier',
          statusCode: 401
        }))
      }

      // Mismatching secret
      if (client.client_secret !== clientSecret) {
        return callback(new AuthorizationError({
          error: 'unauthorized_client',
          error_description: 'Mismatching client secret',
          statusCode: 401
        }))
      }

      callback(null, client)
    })
  }
791565
function async(callback)
{
  var isAsync = false;

  // check if async happened
  defer(function() { isAsync = true; });

  return function async_callback(err, result)
  {
    if (isAsync)
    {
      callback(err, result);
    }
    else
    {
      defer(function nextTick_callback()
      {
        callback(err, result);
      });
    }
  };
}
277118
function status( $asObject = false )
    {
        if ( $asObject )
            return eZOrderStatus::fetch( $this->StatusID );
        else
            return $this->StatusID;
    }
921406
function getPort (port, callback) {
  const server = net.createServer()

  server.on('error', () => {
    getPort(++port, callback)
  })

  // Explicitly listen on 0.0.0.0 to detect ports used by Docker
  // See: https://github.com/nodejs/node/issues/14034
  server.listen(port, '0.0.0.0', () => {
    server.once('close', () => {
      callback(port)
    })
    server.close()
  })
}
824542
function(parameters,callback){
         if (parameters.requestUrl && parameters.isCluster) {
            var clusterUrl = ortcTreatUrl(parameters.requestUrl);

            getServerFromCluster({
                clusterUri : clusterUrl, 
                appKey : parameters.appKey
            }, 
            function (error, body) {
                if (error != null) {
                    callback('Error getting server from Cluster',null);
                }
                else {
                    var resultUrl = body.substring(body.indexOf('=') + 3, body.length - 2);
                    callback(null,resultUrl);
                }
            });
        }
        else {
            var resultUrl = ortcTreatUrl(parameters.requestUrl);
            callback(null,resultUrl);
        }
    }
529858
public void checkServerState(final AsyncCallback<Boolean> callback, final String standBy, final String success) {

        // :read-attribute(name=process-type)
        final ModelNode operation = new ModelNode();
        operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
        operation.get(NAME).set("server-state");
        operation.get(ADDRESS).setEmptyList();

        dispatchAsync.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {

            @Override
            public void onSuccess(DMRResponse result) {

                ModelNode response = result.get();

                if (response.isFailure()) {
                    callback.onFailure(new RuntimeException("Failed to poll server state"));
                } else {
                    // TODO: only works when this response changes the reload state
                    String outcome = response.get(RESULT).asString();
                    boolean keepRunning = !outcome.equalsIgnoreCase("running");//reloadState.isStaleModel();

                    if (!keepRunning) {

                        // clear state
                        reloadState.reset();

                        Console.info(Console.MESSAGES.successful(success));

                        // clear reload state
                        eventBus.fireEvent(new ReloadEvent());
                    }

                    callback.onSuccess(keepRunning);
                }
            }

            @Override
            public void onFailure(Throwable caught) {
                Console.getMessageCenter().notify(new Message(standBy, caught.getMessage(), Message.Severity.Warning));
            }
        });
    }
503406
def create_status_callback(self, callback=None):
        
        if callback is None:
            return self.callback_func

        def safe_wrapper(id, rlbotstatsus):
            callback(rlbotstatsus)

        return self.game_status_callback_type(wrap_callback(safe_wrapper))
698965
function getResponse( clbk ) {
	if ( typeof clbk !== 'function' ) {
		throw new TypeError( 'getResponse()::invalid input argument. Callback must be a function.' );
	}
	/**
	* FUNCTION: onResponse( error, response, body )
	*	Response handler.
	*
	* @private
	* @param {Object} error - error object
	* @param {Object} response - response object
	* @param {String} body - response body
	*/
	return function onResponse( error, response, body ) {
		var data;
		if ( error ) {
			clbk({
				'status': 502,
				'message': 'Request error. Unable to obtain data.'
			});
			return;
		}
		if ( !body ) {
			clbk({
				'status': 404,
				'message': 'No data returned. Empty body. Ensure all query parameters are correct.'
			});
			return;
		}
		try {
			data = JSON.parse( body );
		} catch ( err ) {
			clbk({
				'status': 502,
				'message': 'Unsupported data format. Response body cannot be parsed as JSON.'
			});
			return;
		}
		if ( Array.isArray( data ) && !data.length ) {
			clbk({
				'status': 404,
				'message': 'No data returned. Empty data array. Ensure all query parameters are correct.'
			});
			return;
		}
		clbk( null, data );
	}; // end FUNCTION onResponse()
}
749912
function (zaproxy, statusFn, callback) {
    var wait = function () {
      statusFn(function (err, body) {
        if (err) {
          callback(err);
          return;
        }
        if (body.status < 100) {
          grunt.log.write('.');
          setTimeout(function () {
            wait(callback);
          }, 1000);
        } else {
          callback(null, body);
        }
      });
    };
    wait();
  }
508033
function getStatus(options, callback) {
  if (typeof options === 'function') {
      callback = options;
  }
  if (typeof callback !== 'function') {
      callback = function() {};
  }
  if (!core.session) {
    throw new Error('You must call init() before getStatus()');
  }

  if (options && options.force) {
    updateSession(function(err, session) {
      callback(err, makeSession(session || core.session));
    });
  } else {
    callback(null, makeSession(core.session));
  }
}
296033
function (callback) {
      return this._request({
        path: this._extension
      }, function (err, body, res) {
        return err
          ? callback(err)
          : callback(null, body.networks, res);
      });
    }
1034401
function ensureConnected(remote, callback) {
  if (remote.getServer()) {
    callback(null, isConnected(remote));
  } else {
    callback(null, false);
  }
}
888264
function (server, callback) {
            var self = this;

            this.$server = server;
            this._start(function(err) {
                self.$started = true;
                callback(err);
            });
        }
461204
function(callback) {
            var that = this;
            var url = this.paths.login;
            var params = {
                username: this.username,
                password: this.password,
                cookie  : '1'
            };

            callback = callback || function() {};
            var wrappedCallback = function(err, response) {
                // Let's make sure that not only did the request succeed, but
                // we actually got a non-empty session key back.
                var hasSessionKey = !!(!err && response.data && response.data.sessionKey);

                if (err || !hasSessionKey) {
                    callback(err || "No session key available", false);
                }
                else {
                    that.sessionKey = response.data.sessionKey;
                    callback(null, true);
                }
            };

            return this.http.post(
                this.urlify(url),
                this._headers(),
                params,
                this.timeout,
                wrappedCallback
            );
        }
762700
function callbackHandler(callback) {
        return function(error, data) {
            if (data === 'OK') {
                callback();
                return;
            }

            callback(error, deserializeResponse(data));
        };
    }