caching - How to use Cache.getOrElse(java.lang.String key, java.util.concurrent.Callable<T> block, int expiration) -
how use cache.getorelse(java.lang.string key, java.util.concurrent.callable block, int expiration) give me example? point how use “expiration",i know means expire time.
by way: want save object cache,and set expire time. when expire time,i can reset object cache.
thanks.
expiration number of seconds object hold in cache. if pass 0 expiration cache doesn't expire , have control hand.
what getorelse check cache, if object not there call callable block passing , adds result cache number of seconds passing expiration time.
i based comment in play framework cache javadoc.
Comments
Post a Comment