检查未来的空集

时间:2017-10-24 00:10:42

标签: java

我有一个Future变量,它返回一组对象。如果那套不是空的话,我正试图采取一些行动。我尝试使用oosSignal.get()抛出异常,我也尝试使用Future.value(oosSignal)来表示类型不兼容。任何帮助将不胜感激。

at com.twitter.util.Function$$anon$3.apply(Function.scala:57)

at com.twitter.util.Future$$anonfun$flatMap$1.apply(Future.scala:893)

at com.twitter.util.Future$$anonfun$flatMap$1.apply(Future.scala:892)

at com.twitter.util.Promise$Transformer.liftedTree1$1(Promise.scala:100)

at com.twitter.util.Promise$Transformer.k(Promise.scala:100)

at com.twitter.util.Promise$Transformer.apply(Promise.scala:110)

at com.twitter.util.Promise$Transformer.apply(Promise.scala:91)

at com.twitter.util.Promise$$anon$3.run(Promise.scala:691)

at com.twitter.concurrent.LocalScheduler$Activation.run(Scheduler.scala:187)

at com.twitter.concurrent.LocalScheduler$Activation.flush(Scheduler.scala:164)

at com.twitter.concurrent.LocalScheduler.flush(Scheduler.scala:217)

at com.twitter.concurrent.Scheduler$.flush(Scheduler.scala:85)

at com.twitter.util.Promise.ready(Promise.scala:534)

at com.twitter.util.Promise.result(Promise.scala:541)

at com.twitter.util.Await$$anonfun$result$1.apply(Awaitable.scala:100)

at com.twitter.concurrent.LocalScheduler.blocking(Scheduler.scala:229)

at com.twitter.concurrent.Scheduler$.blocking(Scheduler.scala:91)

at com.twitter.util.Await$.result(Awaitable.scala:100)

at com.twitter.util.Future.get(Future.scala:722)

at com.pinterest.smartfeed.contentgenerator.FeedSourceContentFetcher.lambda$getAvailableFromFeedSources$13(FeedSourceContentFetcher.java:469)

使用.get()

进行堆栈跟踪
#canvas{
  background:black;
  width:100%;
  height:100%;
  position:absolute;
  z-index: -1;
}

body, html{
  height:100%;
  margin:0;
}



.content{
  display:inline-block;
  width:100%;
  left: 30%;
  top:30%;
  right:-30%;
  position:relative;
}

.card{
  background-color:green;
  width:3%;
  height 100%;
  border: white solid 2px;
}

提前致谢。

0 个答案:

没有答案