Skip to content

Instantly share code, notes, and snippets.

@ruslanbogun
Last active November 14, 2016 15:42
Show Gist options
  • Save ruslanbogun/976cfbc4b0e5f9eeee2c to your computer and use it in GitHub Desktop.
Save ruslanbogun/976cfbc4b0e5f9eeee2c to your computer and use it in GitHub Desktop.
val f: Future[T] = ...
val result: Try[T] = Await.ready(f, Duration.Inf).value.get
val resultEither = result match {
case Success(t) => Right(t)
case Failure(e) => Left(e)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment