Repository navigation
Conversation
…asily to implement
|
The code seems fine, so if you're sure the design is sound, it's all good. I have some doubts myself... I'm having issues understanding the implications of replacing |
|
thenApply / thenAccept are the forms where you ONLY get the successful value. The exception will be thrown when you to CF.get() handle / whenComplete are the forms that area BiFunction/BiConsumer that are given the success value OR the throwable both at the same time The equate to the same thing in practice but the error path is now made visible |
kaqqao
left a comment
There was a problem hiding this comment.
The old code still looks wrong to me... See this line, the executionInstrumentation created there never seems to be called with an exception, i.e. executionInstrumentation.onEnd(exception).
Same for the context created here.
In your new code, it looks correct in all cases.
Even further, since CompletableFuture doesn't even seem to have a callback for exceptional completion only, your approach seems to be literally the only valid one. As such, I'd say definitely merge this.
…mentation-callback-method # Conflicts: # src/main/java/graphql/execution/ExecutionStrategy.java
…mentation-callback-method
…mentation-callback-method
* Fixed javadoc warning * Made the instrumentation callback one method to suit lambdas and be easily to implement * Now with new method shape * fixed shape of chained code
See #592