r-cache

Reactive simple in-memory cache

License

License

GroupId

GroupId

io.github.ufukhalis
ArtifactId

ArtifactId

r-cache
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

r-cache
Reactive simple in-memory cache
Project URL

Project URL

https://github.com/ufukhalis/r-cache
Source Code Management

Source Code Management

https://github.com/ufukhalis/r-cache/tree/master

Download r-cache

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
io.projectreactor : reactor-core jar 3.2.10.RELEASE
org.slf4j : slf4j-api jar 1.7.26

test (2)

Group / Artifact Type Version
io.projectreactor : reactor-test jar 3.2.10.RELEASE
org.junit.jupiter : junit-jupiter jar 5.4.2

Project Modules

There are no modules declared in this project.

Build Status Coverage Status

R-Cache

Reactive simple in-memory cache option.

How to Use

Firstly, you should add latest r-cache dependency to your project.

<dependency>
    <groupId>io.github.ufukhalis</groupId>
    <artifactId>r-cache</artifactId>
    <version>0.1.0</version>
</dependency> 

Then, you can create an instance like below.

RCache<String, String> rCache = new RCache.Builder()
            .maxSize(5) // Default 100
            .expire(Duration.ofSeconds(2)) // Default 5 mins
            .cachePoolSize(5) // Default 10
            .build();

After instance creation, you can use R-Cache methods like below.

Add element to cache

Mono<Void> result = rCache.put("key", "value");

Remove element from cache

Mono<Void> result = rCache.remove("key");

Get element from cache

Mono<String> result = rCache.get("key");

Note

This project is still under development. But you can use in your projects.

For more information about Project Reactor, check the site https://projectreactor.io

License

All code in this repository is licensed under the Apache License, Version 2.0. See LICENCE.

Versions

Version
0.1.0