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.
Warning: may block 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.
Optional Time To Live
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
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
Synchronous API, for the case when you don't want to deal with Futures.