Guest User

Untitled

a guest
Dec 10th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. object CacheActor {
  2. case class FindValue(params: Params)
  3.  
  4. trait Params {
  5. def cacheKey: String
  6. }
  7.  
  8. // Thread pool used by findValueForSender()
  9. val FUTURE_POOL_SIZE = 25
  10.  
  11. private lazy val findValueThreadPoolExecutor =
  12. new ThreadPoolExecutor(FUTURE_POOL_SIZE, FUTURE_POOL_SIZE,
  13. 1, TimeUnit.MINUTES,
  14. new ArrayBlockingQueue(FUTURE_POOL_SIZE, true))
  15.  
  16. implicit lazy val findValueExecutionContext: ExecutionContext =
  17. ExecutionContext.fromExecutor(findValueThreadPoolExecutor)
  18. }
Add Comment
Please, Sign In to add comment