Completes a callback.
@param callback The callback to complete.
@param error Error information (or null).
@param result Result (or null).
974936
public void completeCallback(final Callback callback, final String error, final JsonNode result) {
        ObjectNode req = makeRequest("complete");
        req.put("cbid", callback.getCbid());
        req.put("err", error);
        req.set("result", result);

        this.runtime.requestResponse(req);
    }
250415
public void complete() throws CompletionFailure {
        if (completer != Completer.NULL_COMPLETER) {
            Completer c = completer;
            completer = Completer.NULL_COMPLETER;
            c.complete(this);
        }
    }
930483
function onRequestError(error, result, endCallback) {
      result.currentRetries++;
      async.parallel([
        async.apply(recrawlError, error, result),
        async.apply(retrySameUrl,error, result)
      ],function(error){
          endCallback(error);
      });

  }
389090
def errback(self, result):
        

        assert(isinstance(result, BaseException))
        self._start_callbacks(result, True)
921330
function done( error, results ) {
		if ( error ) {
			return clbk( error );
		}
		if ( results ) {
			return clbk( null, results );
		}
		clbk();
	}
670117
public void requestCompleted (final T result)
    {
        EventQueue.invokeLater(new Runnable() {
            public void run () {
                _target.requestCompleted(result);
            }
        });
    }
10780
public void notifyFailure(final Callback<?> callback, final Throwable error) {
    invokeLater(new Runnable() {
      public void run() {
        callback.onFailure(error);
      }
    });
  }
1254041
function (error, result) {
    // If the login method returns its result but the connection is lost
    // before the data is in the local cache, it'll set an onReconnect (see
    // above). The onReconnect will try to log in using the token, and *it*
    // will call userCallback via its own version of this
    // loggedInAndDataReadyCallback. So we don't have to do anything here.
    if (reconnected)
      return;

    // Note that we need to call this even if _suppressLoggingIn is true,
    // because it could be matching a _setLoggingIn(true) from a
    // half-completed pre-reconnect login method.
    Accounts._setLoggingIn(false);
    if (error || !result) {
      error = error || new Error(
        "No result from call to " + options.methodName);
      onceUserCallback(error);
      return;
    }
    try {
      options.validateResult(result);
    } catch (e) {
      onceUserCallback(e);
      return;
    }

    // Make the client logged in. (The user data should already be loaded!)
    makeClientLoggedIn(result.id, result.token, result.tokenExpires);
    onceUserCallback();
  }
986612
@Override
    public void complete(VirtualConnection vc) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "complete() called: vc=" + vc);
        }
        // The VC might be null if the channel was destroyed before the callback completes
        if (vc != null) {
            HttpInboundServiceContextImpl mySC = (HttpInboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPISC);
            mySC.finishSendError();
        }
    }
599002
function callback(ctx, err, result) {
    if (typeof ctx.custom === 'function') {
      var cust = function () {
        // Bind the callback to itself, so the resolve and reject
        // properties that we bound are available to the callback.
        // Then we push it onto the end of the arguments array.
        return ctx.custom.apply(cust, arguments);
      };
      cust.resolve = ctx.resolve;
      cust.reject = ctx.reject;
      cust.call(null, err, result);
    } else {
      if (err) {
        return ctx.reject(err);
      }
      ctx.resolve(result);
    }
  }
715388
void onSignOutResult(int rstCode, SignOutResult result) {
        HMSAgentLog.i("signOut:callback=" + StrUtils.objDesc(handler) +" retCode=" + rstCode);
        if (handler != null) {
            new Handler(Looper.getMainLooper()).post(new CallbackResultRunnable<SignOutResult>(handler, rstCode, result));
            handler = null;
        }
        retryTimes = MAX_RETRY_TIMES;
    }
999602
public synchronized final void completed(@CheckForNull Throwable error) {
        if (executor!=null) {
            executor.completedAsynchronous(error);
        } else {
            result = error == null ? NULL : error;
        }
    }
600295
def _apply_callback(cls, callback, result):
        
        if not callback.immutable:
            callback.args = (result.id, ) + callback.args
        callback.apply()
121454
public static void postTaskError(final TaskCompletionListener completionListener, final String errorMessage) {
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                if (null != completionListener) {
                    completionListener.onError(errorMessage);
                }
            }
        });
    }
532912
function (err, params) {
                if (!err) {
                  callback && callback(null, params);
                }
                else {
                  callback && callback(err.message || err);
                }
              }
1243442
@Override
  public void onFailure(Throwable cause) {
    checkState();
    for (Callback<T> cb : callbacks) {
      cb.onFailure(cause);
    }
    callbacks = null; // note that we've fired
  }
169879
@Override
    public void handleResult(RHI result) {
        for (ResultHandler<RHI> resultHandler : resultHandlers) {
            resultHandler.handleResult(result);
        }
    }