Created
September 13, 2013 00:04
-
-
Save deanh/6545406 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.openaura.util | |
import com.twitter.util.{Future => FinagleFuture} | |
import scala.concurrent.{Promise, ExecutionContext, Future} | |
object FinagleImplicits { | |
implicit def finagleFuture2AkkaFuture[A](future: FinagleFuture[A])(implicit executor: ExecutionContext): Future[_] = { | |
val promise = Promise[A] | |
future onSuccess { result => | |
promise.success(result) | |
} | |
future onFailure { err => | |
promise.failure(err) | |
} | |
promise.future | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment