summaryrefslogtreecommitdiff
path: root/src/library/scala/concurrent/Promise.scala
diff options
context:
space:
mode:
authoraleksandar <aleksandar@aleksandar-Latitude-E6500.(none)>2012-04-12 20:04:57 +0200
committeraleksandar <aleksandar@aleksandar-Latitude-E6500.(none)>2012-04-12 20:04:57 +0200
commitc7a71c2d5c5afbb3dc047bca20c4b8c72e5c94c9 (patch)
treee3ba24a89c59b4178073c0b4c482b9af84307e13 /src/library/scala/concurrent/Promise.scala
parentaf71b10083ed8f91b9735e363651a64149a5ca89 (diff)
downloadscala-c7a71c2d5c5afbb3dc047bca20c4b8c72e5c94c9.tar.gz
scala-c7a71c2d5c5afbb3dc047bca20c4b8c72e5c94c9.tar.bz2
scala-c7a71c2d5c5afbb3dc047bca20c4b8c72e5c94c9.zip
Making changes in the scala.concurrent package.
Diffstat (limited to 'src/library/scala/concurrent/Promise.scala')
-rw-r--r--src/library/scala/concurrent/Promise.scala18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/library/scala/concurrent/Promise.scala b/src/library/scala/concurrent/Promise.scala
index 8f2bce5d1a..cd22a55ce7 100644
--- a/src/library/scala/concurrent/Promise.scala
+++ b/src/library/scala/concurrent/Promise.scala
@@ -107,15 +107,27 @@ trait Promise[T] {
object Promise {
- /** Creates a new promise.
+ /** Creates a promise object which can be completed with a value.
+ *
+ * @tparam T the type of the value in the promise
+ * @param execctx the execution context on which the promise is created on
+ * @return the newly created `Promise` object
*/
def apply[T]()(implicit executor: ExecutionContext): Promise[T] = new impl.Promise.DefaultPromise[T]()
- /** Creates an already completed Promise with the specified exception
+ /** Creates an already completed Promise with the specified exception.
+ *
+ * @tparam T the type of the value in the promise
+ * @param execctx the execution context on which the promise is created on
+ * @return the newly created `Promise` object
*/
def failed[T](exception: Throwable)(implicit executor: ExecutionContext): Promise[T] = new impl.Promise.KeptPromise[T](Left(exception))
- /** Creates an already completed Promise with the specified result
+ /** Creates an already completed Promise with the specified result.
+ *
+ * @tparam T the type of the value in the promise
+ * @param execctx the execution context on which the promise is created on
+ * @return the newly created `Promise` object
*/
def successful[T](result: T)(implicit executor: ExecutionContext): Promise[T] = new impl.Promise.KeptPromise[T](Right(result))