Coder Social home page Coder Social logo

fengzhizi715 / rxcache Goto Github PK

View Code? Open in Web Editor NEW
137.0 7.0 16.0 2.37 MB

A local reactive cache for Java and Android. Now, it supports heap memory、off-heap memory and disk cache.

License: Apache License 2.0

Java 78.41% Kotlin 21.23% FreeMarker 0.05% HTML 0.31%
rxcache guava-cache caffeine gson fastjson moshi encryption off-heap middleware mapdb

rxcache's Introduction

RxCache

A local reactive cache for Java and Android. Now, it supports heap memory、off-heap memory and disk cache.

RxCache 是一款支持 Java 和 Android 的 Local Cache,目前支持内存、堆外内存、磁盘缓存。

@Tony沈哲 on weibo License Codacy Badge

功能特点:

  • 支持二级缓存:Memory、Persistence
  • 各个缓存可以拥有有效时间,超过时间缓存会过期
  • Memory 默认支持 FIFO、LRU、LFU 算法的实现
  • Memory 支持 Guava Cache、Caffeine、MapDB、OHC、Chronicle-Map 的实现
  • Memory 支持堆外内存(off-heap)
  • Persistence 默认使用 Gson 实现对象的序列化和反序列化
  • Persistence 支持使用 FastJSON、Moshi、Kryo、Hessian、FST、Protobuf 实现对象的序列化和反序列化
  • Persistence 的 AbstractConverter 拥有加密功能,默认使用 AES 128、DES 算法进行加密
  • 支持显示缓存的信息,包括 Memory 缓存使用的统计数据,Persistence 使用的类型和 Converter 的类型
  • 支持缓存 key 同步删除、异步删除的策略
  • 支持 Kotlin, 特别是使用 kotlin extension 模块,可以规避范型擦除
  • 支持 Kotlin Coroutines
  • 支持 Kotlin Result
  • 使用 Builder 模式可以生成复杂对象的 Type
  • 线程安全
  • 支持 RxJava 3、RxJava 2
  • 支持 Retrofit 风格使用缓存

更详细的功能请查看 wiki

Tips

RxCache 1.5.1 以及之前的版本使用 RxJava 2.x,在 RxCache 1.6.0 到 RxCache 2.0 的版本使用 RxJava 3.x。

RxCache 2.0 之后,既支持 RxJava 3.x 也支持 RxJava 2.x,整体设计更为合理。

最新版本

模块 最新版本
rxcache-core
rxcache-rxjava3
rxcache-rxjava2
rxcache-extension
rxcache-extension-coroutines
rxcache-memory-guava-cache
rxcache-memory-caffeine
rxcache-memory-off-heap
rxcache-memory-mapdb
rxcache-memory-ohc
rxcache-memory-chronicle-map
rxcache-converter-fastjson
rxcache-converter-moshi
rxcache-converter-kryo
rxcache-converter-hessian
rxcache-converter-fst
rxcache-converter-protobuf
rxcache-persistence-okio
rxcache-persistence-mapdb
rxcache-persistence-diskmap

将它添加到项目的 root build.gradle 中:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

感谢

Contributors:

TODO List:

  • 支持 Java 11 以上

联系方式

Wechat:fengzhizi715

Java与Android技术栈:每周更新推送原创技术文章,欢迎扫描下方的公众号二维码并关注,期待与您的共同成长和进步。

License

Copyright (C) 2018 - present, Tony Shen.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

rxcache's People

Contributors

codacy-badger avatar fengzhizi715 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rxcache's Issues

缓存的策略选择

作者你好,非常感谢你开源的这个缓存库。不过我有个疑问,看代码好像,只能选择memory缓存或者disk缓存。比如我缓存一个对象,是否可以从memory中先获取,如果获取不到,再从disk中获取。这个方式可以进行配置,因为并不是所有情况都有这种情况。
还是已经支持了,我没看到😂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.