Hi!
Spring MVC supports returning CompletableFuture from controllers. Behind the scenes, it will wait for those futures to complete and return the response. However, the only thing that we can annotate are methods in the controller that return those futures, ending almost immediately, while the actual execution could take a significantly longer time.
What would be a good way to time the actual execution time of those CompletableFutures? Could the project somehow be changed to differentiate returning of regular objects and completable futures and optionally measure total execution time for futures?
Hi! Spring MVC supports returning CompletableFuture from controllers. Behind the scenes, it will wait for those futures to complete and return the response. However, the only thing that we can annotate are methods in the controller that return those futures, ending almost immediately, while the actual execution could take a significantly longer time.
What would be a good way to time the actual execution time of those CompletableFutures? Could the project somehow be changed to differentiate returning of regular objects and completable futures and optionally measure total execution time for futures?
Br,