Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java completablefuture chain 2 operations

CompletableFuture<User> getUsersDetail(String userId) {
	return CompletableFuture.supplyAsync(() -> {
		return UserService.getUserDetails(userId);
	});	
}

CompletableFuture<Double> getCreditRating(User user) {
	return CompletableFuture.supplyAsync(() -> {
		return CreditRatingService.getCreditRating(user);
	});
}
Source by www.callicoder.com #
 
PREVIOUS NEXT
Tagged: #java #completablefuture #chain #operations
ADD COMMENT
Topic
Name
2+5 =