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
Here's an example using the twitter bijection library:
import scala.concurrent.{Future => ScalaFuture}
import com.twitter.util.{Future => TwitterFuture}
// extend values by adding the conversion method "as"
import com.twitter.bijection.Conversion.asMethod
// pull in various implicit converters that "as" expects,
// including twitter2ScalaFuture:
import com.twitter.bijection.twitter_util.UtilBijections._
def doSomething: ScalaFuture[T] = {
val response: TwitterFuture[T] = ???
response.as[ScalaFuture[T]]
}