Giter Site home page Giter Site logo

Comments (6)

Ayvytr avatar Ayvytr commented on June 2, 2024

目前已在LoggingInterceptor类使用Executors.newSingleThreadExecutor()进行了Request和Response分开处理,但是效果不理想,如果你有更好的方案请分享一下

private val requestExecutor = Executors.newSingleThreadExecutor()
private val responseExecutor = Executors.newSingleThreadExecutor()

from okhttploginterceptor.

Khaos116 avatar Khaos116 commented on June 2, 2024

就是在方法上增加synchronized,同步锁住
不过可能需要把你这两个方法放到一个方法中,通过布尔值判断了

from okhttploginterceptor.

Khaos116 avatar Khaos116 commented on June 2, 2024

大概就是这样
image

from okhttploginterceptor.

Khaos116 avatar Khaos116 commented on June 2, 2024

当然有可能添加这个又会导致之前版本你说的请求1秒钟,打印5秒钟的问题了,这个要看怎么处理了

from okhttploginterceptor.

Ayvytr avatar Ayvytr commented on June 2, 2024

解决了,发了3.0.4。如果有其他问题再反馈哈

from okhttploginterceptor.

Khaos116 avatar Khaos116 commented on June 2, 2024

感谢大佬

from okhttploginterceptor.

Related Issues (5)

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.