Code Monkey home page Code Monkey logo

Comments (17)

findvoid avatar findvoid commented on June 6, 2024

RxJava1

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

有在多个线程对一个ArrayList 进行操作吗? 可以将你的调用代码贴出来吗

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

我这里是有多个fragment,执行结束后分别调用.compose(DeepApp.getInstance().getRxCache()
.<OperateResult>transformer(
defaultCacheKey()
, new TypeToken<OperateResult>() {
}.getType()
, defaultCacheStrategy()))

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

应该是多线程导致的,嵌套fragment

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

使用版本com.zchu:rxcache:1.2.3

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

内存大小设为0还是会出现相同的问题

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

.memoryMax(0)

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

.transformer(
defaultCacheKey()
, new TypeToken() {
}.getType()
, defaultCacheStrategy()))

如果缓存不是list这种带泛型的type,可以直接传class。还有最好不要用同一个key,估计同时对同一个key的缓存操作就会出现你这种情况

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

我试了一下,开2个线程同时去对同一个key的缓存操作并不会有问题。
另外我说一下我对你遇到的情况的一些疑问。

  1. 我不清楚你具体做了什么操作导致的该异常,是不是在缓存过程中对数据源做了其他操作。
  2. 你缓存的数据源是什么?
  3. 你用的缓存策略是什么?
    如果你的工程源码可以公开,那你可以让我看看。

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

我用的策略需要缓存情况onlyRemote 不需要缓存且有网情况:cacheAndRemote 不需要缓存且无网情况onlyCache,Android系统 7.1.1

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

我稍微测试了一下应该是和系统版本有关系,6.0不会退出

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

测试了一下只有7.0以上系统有崩溃的问题,但是有个问题,我用的策略是CacheStrategy.onlyRemote(),也会崩溃,逻辑上应该是不走cache,这个策略希望可以优化,或者添加一个只走网络请求不缓存的策略.
祝好!

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

只走网络请求不缓存其实跟直接不使用rxcache一样, 你是想动态配置缓存策略吧

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

可以,满足你

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

只走网络请求不缓存的策略已经加上,CacheStrategy.none(),可以切换到v1分支查看。
至于7.0以上系统崩溃的问题,我还是不清楚是什么原因导致。
你可以fork我的工程,在sample中添加导致该错误的代码演示,给我看看

from rxcache.

z-chu avatar z-chu commented on June 6, 2024

你好,问题已经查明并解决,使用v1.2.5即可

from rxcache.

findvoid avatar findvoid commented on June 6, 2024

好的 我有机会试下 感谢

from rxcache.

Related Issues (20)

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.