using CompletableFuture instead of Callable for asynchronous controller in Spring Boot#3190
Merged
wing328 merged 2 commits intoswagger-api:masterfrom Jun 28, 2016
Merged
Conversation
Contributor
|
@thebignet thanks for the PR on Spring Boot. I've just merged #3133 into master Please pull the latest master and rebase the change accordingly. |
8c2ed57 to
8707ea7
Compare
Contributor
|
I think you can't use CompletableFuture on java7... |
Contributor
Author
|
You're right.How about changing the async property to accept java7 or java8 as a value like what is done for dateLibrary ? Maybe it's simpler to use predefined java8 and async booleans in templates |
8707ea7 to
8dd4a31
Compare
| {{/hasMore}}{{/allParams}}){{^java8}};{{/java8}}{{#java8}} { | ||
| // do some magic! | ||
| return {{#async}}() -> {{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK); | ||
| return {{#async}}{{^java8}}() -> {{/java8}}{{#java8}}CompletableFuture.completedFuture({{/java8}}{{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}}; |
Contributor
There was a problem hiding this comment.
It's a java8 block so {{^java8}}() -> {{/java8}} is not needed
8dd4a31 to
19bb07f
Compare
19bb07f to
2b22efc
Compare
Contributor
|
LGTM. Maybe you can update the java8 spring sample ? |
Contributor
Author
|
Java8 async sample is updated. I used a separate commit, but feel free to squash the branch commit before merging |
Contributor
|
@thebignet thanks for the PR. I've merged it into master. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.