lspace.services.util.scala Maven / Gradle / Ivy
package lspace.services
object util {
import com.twitter.util.{Future => TwFuture}
import scala.concurrent.{Future => ScFuture, Promise => ScPromise}
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = {
val prom = ScPromise[T]()
twFuture.onSuccess { res: T =>
prom.success(res)
}
twFuture.onFailure { t: Throwable =>
prom.failure(t)
}
prom.future
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy