-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
3.x: Widen functional interface throws, replace Callable with Supplier #6511
3.x: Widen functional interface throws, replace Callable with Supplier #6511
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.x #6511 +/- ##
============================================
- Coverage 98.22% 98.17% -0.06%
+ Complexity 6294 6293 -1
============================================
Files 675 675
Lines 45165 45170 +5
Branches 6246 6246
============================================
- Hits 44363 44344 -19
- Misses 250 288 +38
+ Partials 552 538 -14
Continue to review full report at Codecov.
|
* A functional interface (callback) that provides a single value or | ||
* throws an exception. | ||
* <p> | ||
* Thins interface was added to allow throwing any subclass of {@link Throwable}s, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: This
@@ -22,16 +22,16 @@ | |||
* <p> | |||
* Implementors of {@link #call()} should not throw any exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link should now point to get()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Posted an update with additional cleanups.
Motivation: Recently RxJava 3 has been released. https://github.com/ReactiveX/RxJava/releases/tag/v3.0.0 Armeria supports RxJava2 integration with `armeria-rxjava`. This PR migrates `RequestContextAssembly` from RxJava2 to RxJava3. RxJava 3 being based on Java 8 also supports seamless conversions between CompletionStage and Single, Maybe, Observable. Modifications: * Rename original `armeria-rxjava` to `armeria-rxjava2` * Make armeria-rxjava support RxJava 3 * Use built-in converter methods for ObservableResponseConverterFunction * Change `*Callable` to `*Supplier` ReactiveX/RxJava#6511 * Don't migrate `RequestContextScalarCallableCompletable` and `RequestContextCallableCompletable` There is no subclasses of `Completable` that implement `Supplier` * Delegate `reset()` in `ConnectableFlowable` https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0#connectable-source-reset Result: You can now use RxJava 3 with Armeria. Fixes: line#2378
Motivation: Recently RxJava 3 has been released. https://github.com/ReactiveX/RxJava/releases/tag/v3.0.0 Armeria supports RxJava2 integration with `armeria-rxjava`. This PR migrates `RequestContextAssembly` from RxJava2 to RxJava3. RxJava 3 being based on Java 8 also supports seamless conversions between CompletionStage and Single, Maybe, Observable. Modifications: * Rename original `armeria-rxjava` to `armeria-rxjava2` * Make `armeria-rxjava` support RxJava 3 * Use built-in converter methods for ObservableResponseConverterFunction * Change `*Callable` to `*Supplier` ReactiveX/RxJava#6511 * Remove `assemblyContext.push()` in `RequestContextScalarCallable*.get()` * Don't need to push `RequestContext` for scalar type such as `Maybe.just(T)` * Delegate `reset()` method to `RequestContextConnectableFlowable`, `RequestContextConnectableObservable` https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0#connectable-source-reset * Migrate `examples/context-propagation/rxjava` to RxJava 3 Result: You can now use RxJava 3 with Armeria. Fixes: #2378
Motivation: Recently RxJava 3 has been released. https://github.com/ReactiveX/RxJava/releases/tag/v3.0.0 Armeria supports RxJava2 integration with `armeria-rxjava`. This PR migrates `RequestContextAssembly` from RxJava2 to RxJava3. RxJava 3 being based on Java 8 also supports seamless conversions between CompletionStage and Single, Maybe, Observable. Modifications: * Rename original `armeria-rxjava` to `armeria-rxjava2` * Make `armeria-rxjava` support RxJava 3 * Use built-in converter methods for ObservableResponseConverterFunction * Change `*Callable` to `*Supplier` ReactiveX/RxJava#6511 * Remove `assemblyContext.push()` in `RequestContextScalarCallable*.get()` * Don't need to push `RequestContext` for scalar type such as `Maybe.just(T)` * Delegate `reset()` method to `RequestContextConnectableFlowable`, `RequestContextConnectableObservable` https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0#connectable-source-reset * Migrate `examples/context-propagation/rxjava` to RxJava 3 Result: You can now use RxJava 3 with Armeria. Fixes: line#2378
This PR widens the
throws Exception
intothrows Throwable
in the functional interfaces and adjustscatch (Exception
tocatch(Throwable
where needed.The major change is the replacement of
java.util.concurrent.Callable
in almost all API withio.reactivex.functions.Supplier
which is defined withthrows Throwable
. Since subinterfaces can't widen the throws clause, only narrow it,Supplier
can't extendCallable
.fromCallable
remained in all base classes and a separate PR will introducefromSupplier
.The single-valued fusion now works with
Supplier
andScalarSupplier
types instead ofCallable
andScalarCallable
(removed).