Skip to content

Latest commit

 

History

History
58 lines (49 loc) · 1.67 KB

File metadata and controls

58 lines (49 loc) · 1.67 KB

MapCache

mapcache.svg

Description

MapCache is a local cache for java and jvm applications. It support different cache types, you can seem them on the examples, from the very basic to the most complete.

Features

Cache

var cache = MapCache.config()
        .cache();

Cache with filler

var filler = () -> Map.of("key1", "value1", "key2", "value2", "key3", "value3");
var cacheWithFiller = MapCache.config()
        .filler(filler)
        .cache();

Cache with key expire

var cache = MapCache.config()
        .expireIn(Duration.ofMinutes(15))
        .cache();

Cache with filler and key expire

var filler = () -> Map.of("key1", "value1", "key2", "value2", "key3", "value3");
var cache = MapCache.config()
        .filler(filler).expireIn(Duration.ofMinutes(15))
        .cache();

Cache with scheduled filler

var filler = () -> Map.of("key1", "value1", "key2", "value2", "key3", "value3");
var cache = MapCache.config()
        .filler(filler).every(Duration.ofMinutes(5))
        .cache();

Cache with scheduled filler and key expire

var filler = () -> Map.of("key1", "value1", "key2", "value2", "key3", "value3");
var cache = MapCache.config()
        .filler(filler).every(Duration.ofMinutes(5))
        .expireIn(Duration.ofMinutes(15))
        .cache();

Links used to build this project