Skip to content

Is there a reason getAll() does not lock the data loading like the getOne()? #613

Answered by ben-manes
krishna81m asked this question in Q&A
Discussion options

You must be logged in to vote

This is discussed in the FAQ. Does that help?

A blocking bulk load is supported by AsyncCache because it can insert an in-flight entry immediately. Unfortunately for a synchronous this is not possible, as we lock through ConcurrentHashMap which does not allow a caller to compute multiple entries at once. Usually the async cache is a good fit since expensive calls can mean remote calls so per-entry futures fits the mental model.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@krishna81m
Comment options

@ben-manes
Comment options

Answer selected by ben-manes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants