-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Sys, concurrent, runtime (1): filled in @param, @tparam, and @return tags that were missed last time #26119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Sys, concurrent, runtime (1): filled in @param, @tparam, and @return tags that were missed last time #26119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,6 +284,7 @@ trait Future[+T] extends Awaitable[T] { | |
| * | ||
| * @tparam S the type of the returned `Future` | ||
| * @param ev evidence that `T` is itself a `Future[S]` | ||
| * @return a `Future` with the result of the inner `Future` | ||
| * @group Transformations | ||
| */ | ||
| def flatten[S](implicit ev: T <:< Future[S]): Future[S] = flatMap(ev)(using parasitic) | ||
|
|
@@ -325,6 +326,7 @@ trait Future[+T] extends Awaitable[T] { | |
| * | ||
| * @param p the predicate to apply to the successful result of this `Future` | ||
| * @param executor the `ExecutionContext` on which the predicate will be executed | ||
| * @return a `Future` which will hold the successful result of this `Future` if it matches the predicate or a `NoSuchElementException` | ||
| */ | ||
| final def withFilter(p: T => Boolean)(implicit executor: ExecutionContext): Future[T] = filter(p)(using executor) | ||
|
|
||
|
|
@@ -446,6 +448,7 @@ trait Future[+T] extends Awaitable[T] { | |
| * @tparam R the type of the resulting `Future` | ||
| * @param that the other `Future` | ||
| * @param f the function to apply to the results of `this` and `that` | ||
| * @param executor the `ExecutionContext` on which `f` will be executed | ||
| * @return a `Future` with the result of the application of `f` to the results of `this` and `that` | ||
| * @group Transformations | ||
| */ | ||
|
|
@@ -749,6 +752,8 @@ object Future { | |
| * @tparam CC the type of the `IterableOnce` of Futures | ||
| * @tparam To the type of the resulting collection | ||
| * @param in the `IterableOnce` of Futures which will be sequenced | ||
| * @param bf the `BuildFrom` used to construct the resulting collection `To` from the values of type `A` | ||
| * @param executor the `ExecutionContext` on which the sequencing will be executed | ||
| * @return the `Future` of the resulting collection | ||
| */ | ||
| final def sequence[A, CC[X] <: IterableOnce[X], To](in: CC[Future[A]])(implicit bf: BuildFrom[CC[Future[A]], A, To], executor: ExecutionContext): Future[To] = | ||
|
|
@@ -834,6 +839,8 @@ object Future { | |
| * @param zero the start value of the fold | ||
| * @param op the fold operation to be applied to the zero and futures | ||
| * @return the `Future` holding the result of the fold | ||
| * | ||
| * @param executor the `ExecutionContext` on which the fold operation will be executed | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think will be good to be before the @return . |
||
| */ | ||
| final def foldLeft[T, R](futures: scala.collection.immutable.Iterable[Future[T]])(zero: R)(op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] = | ||
| foldNext(futures.iterator, zero, op) | ||
|
|
@@ -902,6 +909,8 @@ object Future { | |
| * @param futures the `scala.collection.immutable.Iterable` of Futures to be reduced | ||
| * @param op the reduce operation which is applied to the results of the futures | ||
| * @return the `Future` holding the result of the reduce | ||
| * | ||
| * @param executor the `ExecutionContext` on which the reduce operation will be executed | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will be better if it is before the @return ? |
||
| */ | ||
| final def reduceLeft[T, R >: T](futures: scala.collection.immutable.Iterable[Future[T]])(op: (R, T) => R)(implicit executor: ExecutionContext): Future[R] = { | ||
| val i = futures.iterator | ||
|
|
@@ -926,6 +935,9 @@ object Future { | |
| * @param in the collection to be mapped over with the provided function to produce a collection of Futures that is then sequenced into a Future collection | ||
| * @param fn the function to be mapped over the collection to produce a collection of Futures | ||
| * @return the `Future` of the collection of results | ||
| * | ||
| * @param bf the `BuildFrom` used to construct the resulting collection `M[B]` from the values of type `B` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to be before @return ? |
||
| * @param executor the `ExecutionContext` on which `fn` and the resulting Futures will be executed | ||
| */ | ||
| final def traverse[A, B, M[X] <: IterableOnce[X]](in: M[A])(fn: A => Future[B])(implicit bf: BuildFrom[M[A], B, M[B]], executor: ExecutionContext): Future[M[B]] = | ||
| in.iterator.foldLeft(successful(bf.newBuilder(in))) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ class SyncVar[A] { | |
| * It never returns negative results. | ||
| * | ||
| * @param timeout the maximum time to wait, in milliseconds | ||
| * @return the elapsed wait time in milliseconds, or `0` if `timeout <= 0` or the elapsed time was negative | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part: or the elapsed time was negative is a bit confusing, the original comment of 'never returns negative results' should be better. |
||
| */ | ||
| private def waitMeasuringElapsed(timeout: Long): Long = if (timeout <= 0) 0 else { | ||
| val start = System.nanoTime() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the second part of the sentence, may be something like this is clearer:
... or a
Futurein failed state withNoSuchElementException