Created
August 25, 2012 16:59
-
-
Save ericacm/3467899 to your computer and use it in GitHub Desktop.
Auto Updating Caching System - CacheActorObject.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CacheActor { | |
case class FindValue(params: Params) | |
trait Params { | |
def cacheKey: String | |
} | |
// Thread pool used by findValueForSender() | |
val FUTURE_POOL_SIZE = 25 | |
private lazy val findValueThreadPoolExecutor = | |
new ThreadPoolExecutor(FUTURE_POOL_SIZE, FUTURE_POOL_SIZE, | |
1, TimeUnit.MINUTES, | |
new ArrayBlockingQueue(FUTURE_POOL_SIZE, true)) | |
implicit lazy val findValueExecutionContext: ExecutionContext = | |
ExecutionContext.fromExecutor(findValueThreadPoolExecutor) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment