diff options
author | aleksandar <aleksandar@aleksandar-Latitude-E6500.(none)> | 2012-04-12 20:04:57 +0200 |
---|---|---|
committer | aleksandar <aleksandar@aleksandar-Latitude-E6500.(none)> | 2012-04-12 20:04:57 +0200 |
commit | c7a71c2d5c5afbb3dc047bca20c4b8c72e5c94c9 (patch) | |
tree | e3ba24a89c59b4178073c0b4c482b9af84307e13 /src/library/scala/concurrent/Promise.scala | |
parent | af71b10083ed8f91b9735e363651a64149a5ca89 (diff) | |
download | scala-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.scala | 18 |
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)) |