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

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

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

Future.flatMap介绍

暂无

代码示例

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

@Benchmark
public String flatMapConstN() throws Exception {
 Future<String> f = constFuture;
 for (int i = 0; i < N.n; i++)
  f = f.flatMap(flatMapF, ec);
 return Await.result(f, inf);
}

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

@Benchmark
public String flatMapConst() throws Exception {
 return Await.result(constFuture.flatMap(flatMapF, ec), inf);
}

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

private Future<Integer> loop(int i) {
 if (i > 0)
  return Future.successful(i - 1).flatMap(this::loop, ec);
 else
  return Future.successful(0);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

.flatMap(new Mapper<KvStateLocation, Future<byte[]>>() {
  @Override
  public Future<byte[]> apply(KvStateLocation lookup) {

代码示例来源:origin: dataArtisans/yahoo-streaming-benchmark

Future<Object> result =  actorRefFuture.flatMap(new Mapper<ActorRef, Future<Object>>() {
  public Future<Object> apply(ActorRef actorRef) {
    LOG.debug("Ask response actor for state for key {}.", queryState.getKey());

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

@Benchmark
public String flatMapPromiseN() throws Exception {
 Promise<String> p = Promise.<String>apply();
 Future<String> f = p.future();
 for (int i = 0; i < N.n; i++)
  f = f.flatMap(flatMapF, ec);
 p.success(string);
 return Await.result(f, inf);
}

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

@Benchmark
public String flatMapPromise() throws Exception {
 Promise<String> p = Promise.<String>apply();
 Future<String> f = p.future().flatMap(flatMapF, ec);
 p.success(string);
 return Await.result(f, inf);
}

代码示例来源:origin: org.apache.flink/flink-runtime-web_2.10

.flatMap(new Mapper<ActorRef, Future<Tuple2<ActorGateway, Object>>>() {
  @Override
  public Future<Tuple2<ActorGateway, Object>> apply(ActorRef jobManagerRef) {

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

.flatMap(new Mapper<ActorGateway, Future<Object>>() {
  @Override
  public Future<Object> apply(ActorGateway jobManager) {

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

scala.concurrent.Future<R> flatMappedFuture = scalaFuture.flatMap(new Mapper<T, scala.concurrent.Future<R>>() {
  @Override
  public scala.concurrent.Future<R> apply(T value) {

相关文章