本文整理了Java中scala.concurrent.Promise.failure()
方法的一些代码示例,展示了Promise.failure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Promise.failure()
方法的具体详情如下:
包路径:scala.concurrent.Promise
类名称:Promise
方法名:failure
暂无
代码示例来源:origin: square/retrofit
@Override public void onFailure(Call<T> call, Throwable t) {
promise.failure(t);
}
});
代码示例来源:origin: square/retrofit
@Override public void onFailure(Call<T> call, Throwable t) {
promise.failure(t);
}
});
代码示例来源:origin: square/retrofit
@Override public void onResponse(Call<T> call, Response<T> response) {
if (response.isSuccessful()) {
promise.success(response.body());
} else {
promise.failure(new HttpException(response));
}
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Completes the promise with an exception
*
* @param t The exception to fail the promise with
*/
public void failure(Throwable t) {
this.promise.failure(t);
}
代码示例来源:origin: com.twitter/scalding-core_2.10
public boolean onThrowable(Flow f, Throwable t) {
result.failure(t);
// The exception is handled by the owner of the promise and should not be rethrown
return true;
}
});
代码示例来源:origin: com.typesafe.play/play-java-ws
@Override
public void onThrowable(Throwable t) {
scalaPromise.failure(t);
}
});
代码示例来源:origin: com.github.gitssie/play-transport
@Override
public void onError(Throwable throwable) {
promise.failure(throwable);
}
@Override
代码示例来源:origin: com.twitter/scalding-core
public boolean onThrowable(Flow f, Throwable t) {
result.failure(t);
// The exception is handled by the owner of the promise and should not be rethrown
return true;
}
});
代码示例来源:origin: com.typesafe.play/play-ahc-ws-standalone
@Override
public void onThrowable(Throwable t) {
scalaPromise.failure(t);
}
}
代码示例来源:origin: com.typesafe.play/play-ahc-ws-standalone_2.12
@Override
public void onThrowable(Throwable t) {
scalaPromise.failure(t);
}
}
代码示例来源:origin: opendaylight/controller
@Override
public void onFailure(final Throwable failure) {
LOG.warn("Unable to retrieve schema source from provider", failure);
promise.failure(failure);
}
}, MoreExecutors.directExecutor());
代码示例来源:origin: org.opendaylight.controller/sal-clustering-commons
@Override
public void onFailure(Throwable t) {
LOG.warn("Unable to retrieve schema source from provider", t);
promise.failure(t);
}
});
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public void handleError(Exception exception) {
if (!connectionInfo.isCompleted()) {
connectionInfo.failure(exception);
}
}
}
代码示例来源:origin: com.github.gitssie/play-transport
@Override
public void cancelled() {
circuitBreaker.markFailure();
promise.failure(CANCEL_EXCEPTION);
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
@Override
public void handleError(Exception exception) {
if (!connectionInfo.isCompleted()) {
connectionInfo.failure(exception);
}
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
@Override
public void handleError(Exception exception) {
if (!futureActorGateway.isCompleted()) {
futureActorGateway.failure(exception);
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
if (leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
try {
final LeaderConnectionInfo leaderConnectionInfo = new LeaderConnectionInfo(leaderAddress, leaderSessionID);
connectionInfo.success(leaderConnectionInfo);
} catch (FlinkException e) {
connectionInfo.failure(e);
}
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
if (leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
try {
final LeaderConnectionInfo leaderConnectionInfo = new LeaderConnectionInfo(leaderAddress, leaderSessionID);
connectionInfo.success(leaderConnectionInfo);
} catch (FlinkException e) {
connectionInfo.failure(e);
}
}
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
if (leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
try {
final LeaderConnectionInfo leaderConnectionInfo = new LeaderConnectionInfo(leaderAddress, leaderSessionID);
connectionInfo.success(leaderConnectionInfo);
} catch (FlinkException e) {
connectionInfo.failure(e);
}
}
}
代码示例来源:origin: com.typesafe.play/play-ahc-ws-standalone
CompletionStage<StandaloneWSResponse> execute(Request request) {
final Promise<StandaloneWSResponse> scalaPromise = scala.concurrent.Promise$.MODULE$.apply();
AsyncCompletionHandler<Response> handler = new ResponseAsyncCompletionHandler(scalaPromise);
try {
asyncHttpClient.executeRequest(request, handler);
} catch (RuntimeException exception) {
scalaPromise.failure(exception);
}
Future<StandaloneWSResponse> future = scalaPromise.future();
return FutureConverters.toJava(future);
}
内容来源于网络,如有侵权,请联系作者删除!