Improve Mono fromFuture/fromCompletionStage javadocs#3272
Conversation
|
this is |
|
relates to #3252 could be useful to Reactor-Netty for Netty5 as they have to wrap a Netty5 future that is |
|
fixes #3235 |
There was a problem hiding this comment.
After this + recent changes, there are 2 fromCompletionStage and 5 fromFuture methods, which is a bit much. It seems to me the changes here evolve the original API, and effectively supersede the original fromCompletionStage methods + the fromFutureCompletableFuture, so maybe those could be deprecated accordingly so that the count eventually comes down to 4?
|
this isn't so great anyway, because with widened types the
I will refocus this PR to be a documentation improvement only (as per the linked issue) |
This commit widens the type of `Mono.fromFuture` to accept any class which is both a `CompletionStage` and a `Future`. In the case of `fromFuture(CompletableFuture)`, the original signature is kept for binary compatibility but an overload with the intersection type is also provided. In the case of `Supplier` based overloads and of methods that were just introduced in the current snapshot, CompletableFuture type is replaced with the intersection type. Javadocs of all these methods as well as the fromCompletionStage methods has been revised to better reflect this and hint at the cancellation behavior.
834943f to
6db309d
Compare
|
@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to |
This commit revises javadocs of Mono fromFuture and fromCompletionStage methods to better reflect the cancellation behavior. Fixes #3252.
This commit revises javadocs of Mono fromFuture and fromCompletionStage
methods to better reflect the cancellation behavior.
Fixes #3252.