use of akka.http.javadsl.server.RouteResult in project mantis by Netflix.
the class JobClusterRoute method createCache.
private Cache<Uri, RouteResult> createCache(ActorSystem actorSystem) {
final CachingSettings defaultCachingSettings = CachingSettings.create(actorSystem);
final LfuCacheSettings lfuCacheSettings = defaultCachingSettings.lfuCacheSettings().withInitialCapacity(5).withMaxCapacity(50).withTimeToLive(Duration.create(1, TimeUnit.SECONDS));
final CachingSettings cachingSettings = defaultCachingSettings.withLfuCacheSettings(lfuCacheSettings);
// Created outside the route to potentially allow using
// the same cache across multiple calls
final Cache<Uri, RouteResult> jobClustersListCache = LfuCache.create(cachingSettings);
return jobClustersListCache;
}
Aggregations