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

Deprecate ListenableFuture in favor of CompletableFuture #27780

Closed
rstoyanchev opened this issue Dec 7, 2021 · 2 comments
Closed

Deprecate ListenableFuture in favor of CompletableFuture #27780

rstoyanchev opened this issue Dec 7, 2021 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: messaging Issues in messaging modules (jms, messaging) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

For application facing APIs, we can provide CompletionStage alternatives. For internal usages, we could retain it or phase it out completely.

@rstoyanchev rstoyanchev added in: messaging Issues in messaging modules (jms, messaging) in: web Issues in web modules (web, webmvc, webflux, websocket) in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Dec 7, 2021
@rstoyanchev rstoyanchev added this to the 6.0 M2 milestone Dec 7, 2021
@jhoeller jhoeller modified the milestones: 6.0 M2, 6.0 M3 Dec 9, 2021
@sdeleuze
Copy link
Contributor

+1 for phasing it out, that would improve clarity for users to not have too much alternatives, and with CompletionStage and Mono I think we are covered.

@poutsma poutsma self-assigned this Feb 1, 2022
@poutsma poutsma modified the milestones: 6.0.0-M3, 6.0.0-M4 Mar 15, 2022
@poutsma poutsma modified the milestones: 6.0.0-M4, 6.0.0-M5 May 9, 2022
@poutsma poutsma modified the milestones: 6.0.0-M5, 6.0.0-M6 Jul 11, 2022
@poutsma poutsma changed the title Review use of ListenableFuture Deprecate ListenableFuture in favor of CompletableFuture Jul 25, 2022
@poutsma
Copy link
Contributor

poutsma commented Jul 27, 2022

This is now complete:

  • Deprecation of ListenableFuture and related types (ListenableFutureCallback, SettableListenableFuture, etc.)
  • Deprecation of AsyncListenableTaskExecutor in favor of default methods in AsyncTaskExecutor (submitCompletable).
  • AsyncHandlerMethodReturnValueHandler now has toCompletableFuture instead of toListenableFuture.
  • WebSocketClient now has execute methods, which do the same as doHandshake, but return CompletableFutures (cf. the reactive WebSocketClient).

All other changes:

  • add an overloaded method that takes a CompletableFuture parameter instead of ListenableFuture, and/or
  • add a method with a 'Async' suffix that returns a CompletableFuture instead of a ListenableFuture (connectAsync, sendAsync).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: messaging Issues in messaging modules (jms, messaging) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants