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

rewrite the core implementation and introduce a 2nd version of the programmatic API #1077

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Nov 18, 2024

Resolves #796

The `Action` interface is basically a `Runnable` whose `run` method
declares a checked exception of type `Exception`. It is generally
useful in more tests than just timing tests.
This has never been used and there's no need to keep it anymore.
…tions

This usually consists of dropping the old synchronous implementation and
renaming and adapting the old asynchronous implementation (`CompletionStage*`).
Some of the new implementations still contain extra code for handling
synchronous interrupts, mainly to keep all unit tests passing.

The pseudo-async invocations (methods returning `java.util.concurrent.Future`)
still have a few dedicated strategies (`FutureExecution`, `FutureTimeout`),
but those are not supported in the programmatic API, which will benefit most
from this unification.

This commit also renames `InvocationContext` to `FaultToleranceContext` and
`InvocationContextEvent` to `FaultToleranceEvent`.
This includes the `Guard` and `TypedGuard` types, together with
the `@ApplyGuard` interceptor binding annotation. These types unify
synchronous and asynchronous invocations, using the new fault tolerance
strategies introduced earlier.

The `Guard` and `TypedGuard` interfaces, as well as their implementations,
currently experience rather heavy code duplication; this can be solved
in the future (probably by generating the code from a template).

The first version of the programmatic API (`FaultTolerance` and
`@ApplyFaultTolerance`) continues to exist, but is deprecated for removal.
It will be removed in SmallRye Fault Tolerance 7.0.
@Ladicek Ladicek added this to the 6.7.0 milestone Nov 18, 2024
@Ladicek Ladicek merged commit 2c72065 into smallrye:main Nov 18, 2024
13 checks passed
@Ladicek Ladicek deleted the big-async-rewrite branch November 18, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve reusability of programmatic FaultTolerance instances
1 participant