Configuration options for ScalaCache
Configuration options for ScalaCache
A global prefix that should be prepended to all cache keys. Useful for namespacing if you are sharing your cache with another application.
The value used to separate different parts of a cache key
Author: c-birchall Date: 2014/04/22
Helper methods for logging
Helper methods for logging
Author: chris Created: 4/9/14
Container holding the cache itself, along with all necessary configuration.
Container holding the cache itself, along with all necessary configuration.
The cache itself
Configuration related to method memoization
Wrap the given block with a caching decorator.
Wrap the given block with a caching decorator. First look in the cache. If the value is found, then return it immediately. Otherwise run the block and save the result in the cache before returning it.
Note: Because no TTL is specified, the result will be stored in the cache indefinitely.
the type of the block's result
data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.
the block to run
the result, either retrived from the cache or returned by the block
Wrap the given block with a caching decorator.
Wrap the given block with a caching decorator. First look in the cache. If the value is found, then return it immediately. Otherwise run the block and save the result in the cache before returning it.
The result will be stored in the cache until the given TTL expires.
the type of the block's result
data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.
Time To Live
the block to run
the result, either retrived from the cache or returned by the block
Get the value corresponding to the given key from the cache.
Get the value corresponding to the given key from the cache.
Depending on the cache implementation, this may be done synchronously or asynchronously, so it returns a Future.
the type of the corresponding value
data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.
the value, if there is one
Convenience method to get a value from the cache synchronously.
Convenience method to get a value from the cache synchronously. Warning: may block indefinitely!
the type of the corresponding value
data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.
the value, if there is one
Utilities for memoizing the results of method calls in a cache.
Utilities for memoizing the results of method calls in a cache. The cache key is generated from the method arguments using a macro, so that you don't have to bother passing them manually.
Insert the given key-value pair into the cache, with an optional Time To Live.
Insert the given key-value pair into the cache, with an optional Time To Live.
Depending on the cache implementation, this may be done synchronously or asynchronously, so it returns a Future.
the type of the corresponding value
data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.
the value to be cached
Time To Live (optional, if not specified then the entry will be cached indefinitely)
Remove the given key and its associated value from the cache, if it exists.
Remove the given key and its associated value from the cache, if it exists. If the key is not in the cache, do nothing.
Depending on the cache implementation, this may be done synchronously or asynchronously, so it returns a Future.
data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.
Author: chris Created: 4/21/14