Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final case class Failure[+T](exception: Throwable) extends Try[T]`
- final case class Failure(exception: Throwable) extends Try[Nothing]`
- object None extends Option[Nothing]
- def zip[U](that: Future[U]): Future[(T, U)] = {
- implicit val ec = internalExecutor
- val p = Promise[(T, U)]()
- onComplete {
- case f: Failure[_] => p complete f.asInstanceOf[Failure[(T, U)]]
- case Success(s) => that onComplete { c => p.complete(c map { s2 => (s, s2) }) }
- }
- p.future
- }
- case f: Failure[_] => p complete f.asInstanceOf[Failure[(T, U)]]
- case f: Failure => p complete f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement