Custom executor service in Caffeine cache (AsyncLoader) #508
Answered
by
ben-manes
ankushjindal81
asked this question in
Q&A
-
I am using Caffeine AsyncLoader to pull some data from third party apis, which take some time. The problem I am facing is Caffeine AsyncLoader uses ForkJoin common pool and I want to pass the previous thread's context to the function which is loading the data. For that I need to use custom executor service in caffeine, so that caffeine can use custom executor service for async loading. Is there any way to do it? |
Beta Was this translation helpful? Give feedback.
Answered by
ben-manes
Feb 24, 2021
Replies: 1 comment 6 replies
-
You can set |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
ben-manes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can set
Caffeine.executor(executor)
in your builder, and it will use that for all calls. Does that help?