Created
December 30, 2015 06:04
-
-
Save chrisphelps/2143a32b1bfbeb842143 to your computer and use it in GitHub Desktop.
Basic example - get a user and look up items for him
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
ListenableFuture<User> user = getUser(args); | |
ListenableFuture<List<Item>> items = Futures.transform(user, | |
new AsyncFunction<User, List<Item>>() { | |
@Override | |
public ListenableFuture<List<Item>> apply(User user) throws Exception { | |
return getItemsForUser(user); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment