You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+34-10Lines changed: 34 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,44 @@
1
-
# 2.5.0
1
+
# 3.0
2
2
3
3
4
4
### Bug Fixes
5
5
6
6
- Improved the reliability of async executions, cancellations, and Timeouts.
7
7
8
-
### Improvements
8
+
### API Changes
9
9
10
-
- Issue #292 - Created an extensible Policy SPI (API changes described below).
11
-
- Issue #254 - Added an explicit `compose` method to `FailsafeExecutor`.
12
-
- Issue #293 - Added `RetryPolicy.withBackoff(Duration, Duration)` and `.withDelay(Duration, Duration)`.
13
-
- Issue #221 - `Executor` instances configured via `FailsafeExecutor.with(Executor)` are now used on all executions, including sync executions, and can be used in conjunction with a separately configured `ExecutorService` or `Scheduler` for async executions.
10
+
This release introduces breaking changes to the API:
14
11
15
-
###API Changes
12
+
#### General
16
13
17
-
This release contains some breaking API changes for users of the standalone `Execution` class and also async executions created via `FailsafeExecutor.runAsyncExecution`, `getAsyncExecution`, or `getStageAsyncExecution`.
14
+
- All files have been moved to the `dev.failsafe` package. Be sure to update your imports.
18
15
19
-
- The `Execution` and `AsyncExecution` methods for recording a result or completing an execution have changed to:
16
+
#### Policies
17
+
18
+
- All policies are now threadsafe and use a builder API. The configuration methods available in the builder are mostly the same as previously with the 2.x policies. Some notes:
19
+
- A policy builder can be created via `.builder()`.
20
+
-`RetryPolicy` and `CircuitBreaker` can be constructed with default values using `.ofDefaults()`.
21
+
- Policy configuration is accessible via a `.getConfig()`.
22
+
- Policies that have required arguments, such as `Fallback` and `Timeout`, have additional factory methods for creating a policy without using a builder, ex: `Fallback.of(this::connectToBackup)` and `Timeout.of(Duration.ofSeconds(10))`. Optional arguments must be specified through a builder, ex: `Timeout.builder(duration).withInterrupt().build()`
23
+
24
+
#### Execution and AsyncExecution
25
+
26
+
- The standalone `Execution` API, and the `AsyncExecution` API created via `FailsafeExecutor.runAsyncExecution`, `getAsyncExecution`, and `getStageAsyncExecution` methods, have been unified to include:
20
27
-`record(R, Throwable)`
21
28
-`recordResult(R)`
22
29
-`recordFailure(Throwable)`
23
30
-`complete()`
24
31
- The previously supported `Execution` and `AsyncExecution` methods for recording a result have been removed. The methods for performing a retry have also been removed. For `Execution`, `isComplete` will indicate whether the execution is complete else is retries can be performed. For `AsyncExecution` retries will automatically be performed, if possible, immediately after a result or failure is recorded.
25
32
- The `Execution` constructor is no longer visible. `Execution` instances must now be constructed via `Execution.of(policies)`.
26
33
-`Execution.getWaitTime()` was renamed to `getDelay()`.
27
-
- Added a type parameter to `ExecutionContext`.
34
+
35
+
#### RetryPolicy and CircuitBreaker
36
+
37
+
- In `RetryPolicyBuilder` and `CircuitBreakerBuilder`:
38
+
-`withDelay` has been renamed to `withDelayFn`.
39
+
-`withDelayOn` has been renamed to `withDelayFnOn`.
40
+
-`withDelayWhen` has been renamed to `withDelayFnWhen`.
41
+
- The above method signatures have also been changed to accept a `ContextualSupplier` instead of a `DelayFunction`, since it provides access to the same information.
28
42
29
43
### SPI Changes
30
44
@@ -36,6 +50,16 @@ The following changes effect the SPI classes, for users who are extending Failsa
36
50
- Several new classes were added to the `spi` package to contain internal execution APIs including `ExecutionInternal`, `SyncExecutionInternal`, and `AsyncExecutionInternal`.
37
51
-`FailsafeFuture` was moved to the SPI package and some method signatures changed.
38
52
53
+
### Improvements
54
+
55
+
- Issue #292 - Created an extensible Policy SPI.
56
+
- Issue #254 - Added an explicit `compose` method to `FailsafeExecutor`.
57
+
- Issue #293 - Added `RetryPolicyBuilder.withBackoff(Duration, Duration)` and `.withDelay(Duration, Duration)`.
58
+
- Issue #221 - `Executor` instances configured via `FailsafeExecutor.with(Executor)` are now used on all executions, including sync executions, and can be used in conjunction with a separately configured `ExecutorService` or `Scheduler` for async executions.
59
+
- Issue #47 - Thread safety is now clearly documented in the policy, policy builder, and policy config classes. Policy and policy config classes are threadsafe. Policy builder classes are not threadsafe.
0 commit comments