A simple zero-dependencies non-distributed TTL in-memory cache
This project is maintained by bytemechanics
A simple zero-dependencies non-distributed Time to Life in-memory cache.
There is a lot of cache solution in market full of capabilities, therefore why another cache system? Basically to have some low-weight short-time cache for medium time consumption operations.
(Please read our Javadoc for further information)
<dependency>
<groupId>org.bytemechanics</groupId>
<artifactId>flashback-cache</artifactId>
<version>X.X.X</version>
</dependency>
Graddle
dependencies {
compile 'org.bytemechanics:flashback-cache:X.X.X'
}
package mypackage;
import org.bytemechanics.cache.flashback.service.CacheServiceSingleton;
public class MyClass{
private static final CacheServiceSingleton cacheService=CacheServiceSingleton.getInstance();
}
MyObject myResolvedValue=cacheService.from("my.cache.key",() -> methodRecoverCacheValue());
MyObject myResolvedValue=cacheService.from("my.cache.key",2l,ChronoUnit.MINUTES,() -> methodRecoverCacheValue());