Skip to content

Now handles CompletableFuture coming back from an un batched DF - #696

Merged
bbakerman merged 4 commits into
graphql-java:masterfrom
bbakerman:672-683-batched-es-complete-futures
Sep 6, 2017
Merged

bbakerman merged 4 commits into
graphql-java:masterfrom
bbakerman:672-683-batched-es-complete-futures

Conversation

@bbakerman

Copy link
Copy Markdown
Member

See #672 and #683

…s-complete-futures

# Conflicts:
#	src/main/java/graphql/execution/batched/UnbatchedDataFetcher.java
@@ -201,6 +202,52 @@ private CompletableFuture<List<ExecutionNode>> resolveField(ExecutionContext exe

}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly moved this up in the file so its near where it gets called and tweaked the DF fetching to use the Async code

@bbakerman

Copy link
Copy Markdown
Member Author

Ok so your original PR fixed this @andimarek but I think there is some refactor value in this one as well reagarding Async and using it commonly in a few places

@andimarek andimarek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good except the now duplicate methode in Async

*
* @return a CompletableFuture of List T
*/
public static <T> CompletableFuture<List<T>> combineAllOf(List<CompletableFuture<T>> listOfFutures) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed: please use each(List<CompletableFuture<U>> futures)

*
* @return a CompletableFuture
*/
public static <T> CompletableFuture<T> toCompletableFuture(T t) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea :-)

@bbakerman
bbakerman merged commit 43eac34 into graphql-java:master Sep 6, 2017
@andimarek andimarek added this to the 5.0 milestone Sep 6, 2017
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.

2 participants