Created
August 15, 2019 02:44
-
-
Save fromdev/6fd0d8b448e9c8dfb805ab872936c605 to your computer and use it in GitHub Desktop.
SampleAsyncCall - Supplier Lambda Example Code
This file contains 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
MyClass myobject = new MyClass(); | |
CompletableFuture<Data> dataCompletableFuture = CompletableFuture.supplyAsync(() -> myobject.getData()); // this is async call with supplier Lambda | |
Data dataObject = dataCompletableFuture.get(); // this is a blocking call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment