Permalink
Browse files

Removing controversial `either` method from Futures API.

* Removes `either` from Future
* No tests need to change, since this was an untested method.
  • Loading branch information...
jsuereth committed Nov 21, 2012
1 parent aef7912 commit ea7246046ee7140ea07c8daa9c14cc2cd3111f5f
Showing with 0 additions and 23 deletions.
  1. +0 −23 src/library/scala/concurrent/Future.scala
@@ -522,29 +522,6 @@ trait Future[+T] extends Awaitable[T] {
p.future
}
- /** Creates a new future which holds the result of either this future or `that` future, depending on
- * which future was completed first.
- *
- * $nonDeterministic
- *
- * Example:
- * {{{
- * val f = future { sys.error("failed") }
- * val g = future { 5 }
- * val h = f either g
- * await(h, 0) // evaluates to either 5 or throws a runtime exception
- * }}}
- */
- def either[U >: T](that: Future[U]): Future[U] = {
- val p = Promise[U]()
- val completePromise: PartialFunction[Try[U], _] = { case result => p tryComplete result }
-
- this onComplete completePromise
- that onComplete completePromise
-
- p.future
- }
-
}

0 comments on commit ea72460

Please sign in to comment.