convert Scala Future to Twitter Future

前端 未结 2 1846
一个人的身影
一个人的身影 2021-02-15 02:26

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

2条回答
  •  盖世英雄少女心
    2021-02-15 02:54

    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.

提交回复
热议问题