Flashback Cache

A simple zero-dependencies non-distributed TTL in-memory cache

License

License

GroupId

GroupId

org.bytemechanics
ArtifactId

ArtifactId

flashback-cache
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Flashback Cache
A simple zero-dependencies non-distributed TTL in-memory cache
Project Organization

Project Organization

Byte Mechanics
Source Code Management

Source Code Management

https://github.com/bytemechanics/flashback-cache

Download flashback-cache

How to add to project

<!-- https://jarcasting.com/artifacts/org.bytemechanics/flashback-cache/ -->
<dependency>
    <groupId>org.bytemechanics</groupId>
    <artifactId>flashback-cache</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.bytemechanics/flashback-cache/
implementation 'org.bytemechanics:flashback-cache:1.0.0'
// https://jarcasting.com/artifacts/org.bytemechanics/flashback-cache/
implementation ("org.bytemechanics:flashback-cache:1.0.0")
'org.bytemechanics:flashback-cache:jar:1.0.0'
<dependency org="org.bytemechanics" name="flashback-cache" rev="1.0.0">
  <artifact name="flashback-cache" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.bytemechanics', module='flashback-cache', version='1.0.0')
)
libraryDependencies += "org.bytemechanics" % "flashback-cache" % "1.0.0"
[org.bytemechanics/flashback-cache "1.0.0"]

Dependencies

test (5)

Group / Artifact Type Version
org.bytemechanics : copy-commons jar 1.5.2
org.junit.jupiter : junit-jupiter-api jar 5.5.2
org.junit.jupiter : junit-jupiter-params jar 5.5.2
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.jmockit : jmockit jar 1.48

Project Modules

There are no modules declared in this project.

Flashback cache

Latest version Quality Gate Coverage License

A simple zero-dependencies non-distributed Time to Life in-memory cache.

Motivation

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.

Quick start

(Please read our Javadoc for further information)

  1. First of all include the Jar file in your compile and execution classpath. Maven
	<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'
}
  1. Allocate the cache service who will store all the cache values, or use the provided singleton
package mypackage;
import org.bytemechanics.cache.flashback.service.CacheServiceSingleton;
public class MyClass{
	private static final CacheServiceSingleton cacheService=CacheServiceSingleton.getInstance();
}
  1. Create a new cache
    • Infinite cache
MyObject myResolvedValue=cacheService.from("my.cache.key",() -> methodRecoverCacheValue());
  • TTL cache (will be keep the same value until the next recover after 2 minutes)
MyObject myResolvedValue=cacheService.from("my.cache.key",2l,ChronoUnit.MINUTES,() -> methodRecoverCacheValue());
org.bytemechanics

ByteMechanics Foundation

Foundation dedicated to provide opensource libraries and resources to simplify developers life

Versions

Version
1.0.0