diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-21 08:01:54 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-21 08:01:54 -0800 |
commit | 57b91c5ee794cb8b66e298594a95a3fc829171f6 (patch) | |
tree | d395f37f55838f095ca08703c5db8c064618628c /src | |
parent | aef791268631ef38aaedd83af87191bdf73196f5 (diff) | |
parent | ea7246046ee7140ea07c8daa9c14cc2cd3111f5f (diff) | |
download | scala-57b91c5ee794cb8b66e298594a95a3fc829171f6.tar.gz scala-57b91c5ee794cb8b66e298594a95a3fc829171f6.tar.bz2 scala-57b91c5ee794cb8b66e298594a95a3fc829171f6.zip |
Merge pull request #1656 from jsuereth/fix/remove-future-either-methodv2.10.0-RC3
Removing controversial `either` method from Futures API.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/concurrent/Future.scala | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/library/scala/concurrent/Future.scala b/src/library/scala/concurrent/Future.scala index 320a4f22b8..4b9e74708d 100644 --- a/src/library/scala/concurrent/Future.scala +++ b/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 - } - } |