Created
August 25, 2012 16:57
-
-
Save ericacm/3467882 to your computer and use it in GitHub Desktop.
Auto Updating Caching System - CachingBusinessService
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
class CachingBusinessService(bizService: BusinessService) | |
extends BusinessService { | |
implicit val timeout = Timeout(60 seconds) | |
val service1CacheActor = | |
cacheSystem.createCacheActor("service1", DATE_CACHE_SIZE, 0 seconds, | |
new Service1CacheActor(_, _, bizService)) | |
// ... more actors created here | |
def service1(date: Date, useFoo: Boolean): Service1Result = { | |
val future = | |
service1CacheActor ? FindValue(new Service1Params(date, useFoo)) | |
Await.result(future, timeout.duration).asInstanceOf[Option[Service1Result]] | |
} | |
// ... more service methods | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment