Comments (6)
目前已在LoggingInterceptor类使用Executors.newSingleThreadExecutor()进行了Request和Response分开处理,但是效果不理想,如果你有更好的方案请分享一下
private val requestExecutor = Executors.newSingleThreadExecutor()
private val responseExecutor = Executors.newSingleThreadExecutor()
from okhttploginterceptor.
就是在方法上增加synchronized,同步锁住
不过可能需要把你这两个方法放到一个方法中,通过布尔值判断了
from okhttploginterceptor.
from okhttploginterceptor.
当然有可能添加这个又会导致之前版本你说的请求1秒钟,打印5秒钟的问题了,这个要看怎么处理了
from okhttploginterceptor.
解决了,发了3.0.4。如果有其他问题再反馈哈
from okhttploginterceptor.
感谢大佬
from okhttploginterceptor.
Related Issues (5)
- 如何打印所有请求相关数据呢 HOT 2
- 关于Gson包找不到的问题 HOT 6
- 下载文件导致OOM HOT 7
- 老哥,没有content-type时,response就不打印了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okhttploginterceptor.