summaryrefslogtreecommitdiff
path: root/src/library/scala/parallel/Future.scala
blob: e255a5772b478791adadbe3e05819bbd0e08f4b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2005-2013, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala.parallel



/** A future is a function without parameters that will block the caller if
 *  the parallel computation associated with the function is not completed.
 *  
 *  @tparam R   the type of the result
 *
 *  @since 2.9
 */
@deprecated("Use `scala.concurrent.Future` instead.", "2.10.0")
trait Future[@specialized +R] extends (() => R) {
  /** Returns a result once the parallel computation completes. If the
   *  computation produced an exception, an exception is forwarded.
   *
   *  '''Note:''' creating a circular dependency between futures by calling
   *  this method will result in a deadlock.
   *
   *  @return     the result
   *  @throws     the exception that was thrown during a parallel computation
   */
  def apply(): R

  /** Returns `true` if the parallel computation is completed.
   *
   *  @return     `true` if the parallel computation is completed, `false` otherwise
   */
  def isDone(): Boolean
}