scala.concurrent.Future.transform()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(198)

本文整理了Java中scala.concurrent.Future.transform()方法的一些代码示例,展示了Future.transform()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Future.transform()方法的具体详情如下:
包路径:scala.concurrent.Future
类名称:Future
方法名:transform

Future.transform介绍

暂无

代码示例

代码示例来源:origin: traneio/future

@Benchmark
public Void ensureConstN() throws Exception {
 Future<Void> f = constVoidFuture;
 for (int i = 0; i < N.n; i++)
  f.transform(ensureF, ec);
 return Await.result(f, inf);
}

代码示例来源:origin: traneio/future

@Benchmark
public Void ensureConst() throws Exception {
 return Await.result(constVoidFuture.transform(ensureF, ec), inf);
}

代码示例来源:origin: org.opendaylight.controller/sal-distributed-datastore

static Future<ActorSelection> transform(final Future<Object> readyReplyFuture, final ActorContext actorContext,
      final TransactionIdentifier identifier) {
    return readyReplyFuture.transform(new TransactionReadyReplyMapper(actorContext, identifier),
      SAME_FAILURE_TRANSFORMER, actorContext.getClientDispatcher());
  }
}

代码示例来源:origin: traneio/future

@Benchmark
public Void ensurePromise() throws Exception {
 Promise<Void> p = Promise.<Void>apply();
 Future<Void> f = p.future().transform(ensureF, ec);
 p.success(null);
 return Await.result(f, inf);
}

代码示例来源:origin: traneio/future

@Benchmark
public Void ensurePromiseN() throws Exception {
 Promise<Void> p = Promise.<Void>apply();
 Future<Void> f = p.future();
 for (int i = 0; i < N.n; i++)
  f = f.transform(ensureF, ec);
 p.success(null);
 return Await.result(f, inf);
}

代码示例来源:origin: org.opendaylight.controller/sal-distributed-datastore

new FindPrimary(shardName, true), shardInitializationTimeout);
return future.transform(new Mapper<Object, PrimaryShardInfo>() {
  @Override
  public PrimaryShardInfo checkedApply(Object response) throws UnknownMessageException {

相关文章