Skip to content

Commit 2869712

Browse files
committed
Update changelog for 3.0
1 parent 2cff355 commit 2869712

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

CHANGELOG.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,44 @@
1-
# 2.5.0
1+
# 3.0
22

33

44
### Bug Fixes
55

66
- Improved the reliability of async executions, cancellations, and Timeouts.
77

8-
### Improvements
8+
### API Changes
99

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:
1411

15-
### API Changes
12+
#### General
1613

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.
1815

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:
2027
- `record(R, Throwable)`
2128
- `recordResult(R)`
2229
- `recordFailure(Throwable)`
2330
- `complete()`
2431
- 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.
2532
- The `Execution` constructor is no longer visible. `Execution` instances must now be constructed via `Execution.of(policies)`.
2633
- `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.
2842

2943
### SPI Changes
3044

@@ -36,6 +50,16 @@ The following changes effect the SPI classes, for users who are extending Failsa
3650
- Several new classes were added to the `spi` package to contain internal execution APIs including `ExecutionInternal`, `SyncExecutionInternal`, and `AsyncExecutionInternal`.
3751
- `FailsafeFuture` was moved to the SPI package and some method signatures changed.
3852

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.
60+
- Added a type parameter to `ExecutionContext`.
61+
- Added `FailsafeExecutor.getPolicies()`.
62+
3963
# 2.4.4
4064

4165
### Bug Fixes

0 commit comments

Comments
 (0)