Delivers {@code result} to {@code callback} on the next game tick (on the PlayN thread).
771014
public <T> void notifySuccess(final Callback<T> callback, final T result) {
    invokeLater(new Runnable() {
      public void run() {
        callback.onSuccess(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;
    }
528021
def _setResult(self, result):
        
        if self._result is not _NO_RESULT:
            raise AlreadyCalledError()

        self._result = result
42137
def callback_result(self):
        """"""
        if self._state in [PENDING, RUNNING]:
            self.x
        if self._user_callbacks:
            return self._callback_result
        else:
            return self.x
539000
private IGPSObject waitForResult() {
		synchronized (this.asyncWaitMutex) {
			if (this.asyncResult == null) {
				try {
					this.asyncWaitMutex.wait(1000);
				} catch (final InterruptedException e) {
					GPSdEndpoint.LOG.info("Interrupted while waiting for result", e);
				}
			}
			final IGPSObject result = this.asyncResult;
			this.asyncResult = null;
			return result;
		}
	}
706017
protected ExecutionResult postExecute(ExecutionResult result) {
    if (isFailure(result)) {
      result = onFailure(result.with(false, false));
      callFailureListener(result);
    } else {
      result = result.with(true, true);
      onSuccess(result);
      callSuccessListener(result);
    }

    return result;
  }
1269908
function (result) {
    // update status
    me.resolved = true;
    me.rejected = false;
    me.pending = false;

    _onSuccess.forEach(function (fn) {
      fn(result);
    });

    _process = function (onSuccess, onFail) {
      onSuccess(result);
    };

    _resolve = _reject = function () { };

    return me;
  }
239628
def sendResult(self, future):
        """"""
        future = copy.copy(future)

        # Remove the (now) extraneous elements from future class
        future.callable = future.args = future.kargs = future.greenlet = None

        if not future.sendResultBack:
            # Don't reply back the result if it isn't asked
            future.resultValue = None

        self._sendReply(
            future.id.worker,
            pickle.dumps(
                future,
                pickle.HIGHEST_PROTOCOL,
            ),
        )
1168910
public void callback(final Callback callback)
    {
        Runnable runnable = new Runnable()
        {
            @Override
            public void run()
            {
                try
                {
                    callback.result(queryId, awaitResult());
                }
                catch (Exception e)
                {
                    callback.error(queryId, e);
                }
            }
        };
        EXECUTOR_SERVICE.submit(runnable);
    }
1105974
def set_result(self, result):
        """"""
        self._result = result
        self._result_set = True
        self._invoke_callbacks(self)
623760
public ExecutionResult withResult(Object result) {
    return new ExecutionResult(result, null, nonResult, waitNanos, true, true, successAll);
  }
1348690
public void complete( T result, Object error ) {
        synchronized (this) {
            if ( isComplete ) {
                throw new RuntimeException("Promise can be completed only once");
            }
            this.result = result;
            this.error = error;
            isComplete = true;
            tryFire();
        }
    }
202464
@Override
    public void onResponse(ReadResultSet<ReliableTopicMessage> result) {
        // we process all messages in batch. So we don't release the thread and reschedule ourselves;
        // but we'll process whatever was received in 1 go.
        for (Object item : result) {
            ReliableTopicMessage message = (ReliableTopicMessage) item;

            if (cancelled) {
                return;
            }

            try {
                listener.storeSequence(sequence);
                process(message);
            } catch (Throwable t) {
                if (terminate(t)) {
                    cancel();
                    return;
                }
            }

            sequence++;
        }
        next();
    }
352569
function (cb) {
            if (cb) {
                if (isPromise(cb)) {
                    cb = cb.callback;
                }
                if (this.__fired && this.__results) {
                    this.__callNextTick(cb, this.__results);
                } else {
                    this.__cbs.push(cb);
                }
            }
            return this;
        }
115120
def set_result(self, result):
        
        # Sanity check: A future can only complete once.
        if self.done():
            raise RuntimeError("set_result can only be called once.")

        # Set the result and trigger the future.
        self._result = result
        self._trigger()
231387
private Throwable getResult(FutureTask<Throwable> task, Thread thread) {
        try {
            if (timeout > 0) {
                return task.get(timeout, timeUnit);
            } else {
                return task.get();
            }
        } catch (InterruptedException e) {
            return e; // caller will re-throw; no need to call Thread.interrupt()
        } catch (ExecutionException e) {
            // test failed; have caller re-throw the exception thrown by the test
            return e.getCause();
        } catch (TimeoutException e) {
            return createTimeoutException(thread);
        }
    }
790301
private void processResult(Executor executor) {
        // Process the result, one entry at a time, until one of the stopping conditions occurs.
        AtomicBoolean shouldContinue = new AtomicBoolean(true);
        Futures
                .loop(
                        () -> !this.closed.get() && shouldContinue.get(),
                        () -> {
                            CompletableFuture<ReadResultEntry> resultEntryFuture = fetchNextEntry();
                            shouldContinue.set(resultEntryFuture != null);
                            return resultEntryFuture != null ? resultEntryFuture : CompletableFuture.completedFuture(null);
                        },
                        resultEntry -> {
                            if (resultEntry != null) {
                                shouldContinue.set(this.entryHandler.processEntry(resultEntry));
                            }
                        },
                        executor)
                .whenComplete((r, ex) -> close(ex)); // Make sure always close the result processor when done (with our without failures).
    }