File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed
src/library/scala/concurrent Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -522,29 +522,6 @@ trait Future[+T] extends Awaitable[T] {
522522 p.future
523523 }
524524
525- /** Creates a new future which holds the result of either this future or `that` future, depending on
526- * which future was completed first.
527- *
528- * $nonDeterministic
529- *
530- * Example:
531- * {{{
532- * val f = future { sys.error("failed") }
533- * val g = future { 5 }
534- * val h = f either g
535- * await(h, 0) // evaluates to either 5 or throws a runtime exception
536- * }}}
537- */
538- def either [U >: T ](that : Future [U ]): Future [U ] = {
539- val p = Promise [U ]()
540- val completePromise : PartialFunction [Try [U ], _] = { case result => p tryComplete result }
541-
542- this onComplete completePromise
543- that onComplete completePromise
544-
545- p.future
546- }
547-
548525}
549526
550527
You can’t perform that action at this time.
0 commit comments