Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Feb 26, 2024
1 parent 5ee1d31 commit d23cc6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/ox/scoped.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ private class DoNothingScope[T] extends StructuredTaskScope[T](null, Thread.ofVi
/** Starts a new scope, which allows starting forks in the given code block `f`. Forks can be started using [[fork]], [[forkUser]],
* [[forkCancellable]] and [[forkUnsupervised]]. All forks are guaranteed to complete before this scope completes.
*
* **Warning:** It is advisable to use [[supevised]] scopes if possible, as they minimise the chances of an error to go unnoticed.
* **Warning:** It is advisable to use [[supervised]] scopes if possible, as they minimise the chances of an error to go unnoticed.
* [[scoped]] scopes are considered an advanced feature, and should be used with caution.
*
* The scope is ran in unsupervised mode, that is:
Expand All @@ -19,6 +19,8 @@ private class DoNothingScope[T] extends StructuredTaskScope[T](null, Thread.ofVi
*
* Forks created using [[fork]], [[forkUser]] and [[forkUnsupervised]] will behave exactly the same.
*
* Upon successful completion, returns the result of evaluating `f`. Upon failure, that is an exception thrown by `f`, it is re-thrown.
*
* @see
* [[supervised]] Starts a scope in supervised mode
*/
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/scala/ox/supervised.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import java.util.concurrent.{CompletableFuture, ConcurrentHashMap}
* - the scope completes (that is, this method returns) only once all forks started by `f` have completed (either successfully, or with
* an exception)
*
* Upon successful completion, returns the result of evaluating `f`. Upon failure, the exception that caused the scope to end is re-thrown
* (regardless if the exception was thrown from the main body, or from a fork). Any other exceptions that occur when completing the scope
* are added as suppressed.
*
* @see
* [[scoped]] Starts a scope in unsupervised mode
*/
Expand Down

0 comments on commit d23cc6b

Please sign in to comment.