Skip to content

Instantly share code, notes, and snippets.

@drawers
Last active August 7, 2017 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drawers/882cd4e872166da94c4b071898060e05 to your computer and use it in GitHub Desktop.
Save drawers/882cd4e872166da94c4b071898060e05 to your computer and use it in GitHub Desktop.
class MainRequestHelper {
private final PlayerRepository playerRepository;
private final GamesRepository gamesRepository;
@Inject
public MainRequestHelper(PlayerRepository playerRepository, GamesRepository gamesRepository, StatisticsProcessor statisticsProcessor) {
this.playerRepository = playerRepository;
this.gamesRepository = gamesRepository;
}
ListenableFuture<Games> retrieveGames(String username) {
return FluentFuture.from(playerRepository.retrieve(username))
.transformAsync( (player) -> gamesRepository.retrieve(player.id()), directExecutor())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment