Skip to content

use Guava cache to return ListenableFuture #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krvibhav
Copy link

@Tam @viettienn

Please review.

Issue: https://github.com/wego/akasha/issues/274
Solution:
Used Guava Cache which ll keep ListenableFuture object based on responseId.
Idea here is if same search happened at the same time, we can use provider requests from both the searches and because we have a guava caching which keeps ListenableFurture object, it ll be non blocking and whenever response is ready for any request it ll be returned to all the requests.

Guava cache suits best here because it handles the concurrency situation properly.

@tamnguyenit
Copy link
Contributor

tamnguyenit commented Jun 21, 2017

There is no issue here @krvibhav, the issue you describe above is for the new provider caching mechanism we are working on that's not related to this asyncHttpCache.

@viettienn
Copy link

Can you write test for this scenario ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants