Skip to content
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

improve timeout reference documentation #886

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Alternative to MicroProfile Fault Tolerance's {@link org.eclipse.microprofile.faulttolerance.Asynchronous @Asynchronous}
* for guarding non-blocking asynchronous methods (executed on the original thread). It may only be present on methods
* that declare return type of {@link java.util.concurrent.CompletionStage CompletionStage}. Otherwise, it has the same
* that declare return type of {@link java.util.concurrent.CompletionStage CompletionStage}. Other than that, it has the same
* meaning as MicroProfile Fault Tolerance's {@link org.eclipse.microprofile.faulttolerance.Asynchronous @Asynchronous}.
* More specifically:
* <p>
Expand Down
5 changes: 4 additions & 1 deletion doc/modules/ROOT/pages/reference/timeout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ For introduction, see xref:howto/timeout.adoc[How to Watch for Timeouts].
If a guarded method takes too long, the caller will get a `TimeoutException`.

If the gaurded method is not `@Asynchronous` or `@AsynchronousNonBlocking`, the thread executing the method is interrupted.
Note that interruption requires cooperation from the executing code.
Note that interruption requires cooperation from the executing code (for example, it must not swallow `InterruptedException`).
In other words, it is not guaranteed that interrupting the method will actually make it stop.

If the gaurded method is `@Asynchronous` or `@AsynchronousNonBlocking`, timeout is always signalled correctly, but there is no cancellation.
Even after timeout, the asynchronous action will keep running; its eventual result is just ignored.

[[interactions]]
== Interactions with Other Strategies

Expand Down