convert Scala Future to Twitter Future

前端 未结 3 1452
情深已故
情深已故 2021-02-15 02:07

I use Finagle as a web server which I want to return Scala-Futures from my application logic. How to convert scala.concurrent.Future to com.twitter.util.Future, in a non-blockin

3条回答
  •  一生所求
    2021-02-15 02:28

    It's also possible to use Twitter bijections library: https://github.com/twitter/bijection

    Namely com.twitter.bijection.twitter_util.UtilBijections (https://github.com/twitter/bijection/blob/develop/bijection-util/src/main/scala/com/twitter/bijection/twitter_util/UtilBijections.scala)

    This library handles important details, for example if you convert object forth and back, it just unwraps original object.

提交回复
热议问题