本文整理了Java中scala.concurrent.Future.transform()
方法的一些代码示例,展示了Future.transform()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Future.transform()
方法的具体详情如下:
包路径:scala.concurrent.Future
类名称: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 {
内容来源于网络,如有侵权,请联系作者删除!