Skip to content

Return CompletableFutures for public-facing operations - #757

Merged
jchambers merged 2 commits into
masterfrom
completable-future
Mar 10, 2020
Merged

Return CompletableFutures for public-facing operations#757
jchambers merged 2 commits into
masterfrom
completable-future

Conversation

@jchambers

@jchambers jchambers commented Mar 6, 2020

Copy link
Copy Markdown
Owner

As a follow-up to #746, this pull request replaces all public-facing uses of io.netty.util.concurrent.Future with java.util.concurrent.CompletableFuture. CompletableFuture is part of the stock Java SDK and offers all of the affordances—most importantly being able to add listeners—that Netty's Future offers.

@jchambers jchambers added this to the v0.14.0 milestone Mar 6, 2020
@jchambers

Copy link
Copy Markdown
Owner Author

I should also point out that this pull request highlights how much non-IO stuff we're inadvertently doing on IO threads. I'll open a follow-up pull request to add an "insulation" layer.

@jchambers jchambers changed the title Return CompletableFuture instances for public-facing operations Return CompletableFutures for public-facing operations Mar 6, 2020
@jchambers
jchambers force-pushed the completable-future branch from 2de735a to 72bfab5 Compare March 7, 2020 20:35
@jchambers

Copy link
Copy Markdown
Owner Author

Also, I'm trying to figure out how to describe the action of calling CompletableFuture#thenApply(...). "Add a listener" seems imprecise since CompletionStage is its own concept in the Java world, but "add a dependent completion stage" also feels a little obtuse for folks who aren't already familiar with CompletableFuture/CompletionStage. I'm rolling with "add a follow-up task" for now, but would love suggestions for alternative phrasing!

@jchambers
jchambers merged commit ce341f5 into master Mar 10, 2020
@jchambers
jchambers deleted the completable-future branch March 10, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant