Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

再次考虑mica-http异步的使用优化 #29

Open
ChunMengLu opened this issue Jun 18, 2020 · 2 comments
Open

再次考虑mica-http异步的使用优化 #29

ChunMengLu opened this issue Jun 18, 2020 · 2 comments

Comments

@ChunMengLu
Copy link
Member

考虑使用 CompletableFuture 对 mica-http 的异步进行优化,方便使用。

@ChunMengLu
Copy link
Member Author

目前的困境:mica-http 做自动关流之后获取 body 都被关闭了。

思考:

  1. 采用 BytesResponse 封装,这样就没了 body 被关闭的问题。要经过 jmh 实测。
  2. 异步采用 CompletableFuture,对同步是否也都采用异步的方式。需要 jmh。

@ChunMengLu
Copy link
Member Author

ChunMengLu commented Jul 4, 2020

已经完成初版,还需要打磨。jmh 实测跟同步差不多,CompletableFuture 需要把多个请求合并发送,才会节省时间。

考虑将多个请求合并的 api 方式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant