zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

Client connection pools

Open vigoo opened this issue 3 years ago • 1 comments

Resolves #1479

TODO:

  • [x] Web socket support is broken possibly due to the dynamic handler registration
  • [x] Try to revert the channel after closed web socket for reuse, or invalidate it in the pool if that is not possible
  • [x] Check if the current handlers already automatically handle the connect/keep-alive headers or if it has to be added
  • [x] Invalidate the failed channels in the pool
  • [x] Configuration for the pools
  • [x] Cleanup
  • [x] Tons of tests

vigoo avatar Sep 16 '22 19:09 vigoo

Codecov Report

Base: 59.23% // Head: 59.70% // Increases project coverage by +0.47% :tada:

Coverage data is based on head (8c52b48) compared to base (bdad790). Patch coverage: 77.30% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1493      +/-   ##
==========================================
+ Coverage   59.23%   59.70%   +0.47%     
==========================================
  Files         111      113       +2     
  Lines        3949     4053     +104     
  Branches      117      118       +1     
==========================================
+ Hits         2339     2420      +81     
- Misses       1610     1633      +23     
Impacted Files Coverage Δ
zio-http/src/main/scala/zio/http/Channel.scala 61.53% <ø> (ø)
...ain/scala/zio/http/netty/NettyFutureExecutor.scala 85.71% <ø> (ø)
...io-http/src/main/scala/zio/http/ClientConfig.scala 58.82% <33.33%> (-7.85%) :arrow_down:
...ttp/netty/client/ClientResponseStreamHandler.scala 62.50% <50.00%> (-37.50%) :arrow_down:
...p/netty/client/ClientInboundStreamingHandler.scala 87.50% <60.00%> (-2.50%) :arrow_down:
...n/scala/zio/http/netty/client/ConnectionPool.scala 71.08% <71.08%> (ø)
...a/zio/http/netty/client/ClientInboundHandler.scala 80.76% <87.50%> (+7.43%) :arrow_up:
zio-http/src/main/scala/zio/http/ZClient.scala 49.25% <97.56%> (+3.79%) :arrow_up:
zio-http/src/main/scala/zio/http/Response.scala 79.16% <100.00%> (ø)
...ain/scala/zio/http/netty/client/ChannelState.scala 100.00% <100.00%> (ø)
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Sep 18 '22 10:09 codecov-commenter

@vigoo Should we just merge this?

jdegoes avatar Oct 17 '22 14:10 jdegoes

If it's ok that it depends on a snapshot ZIO version we can merge it, otherwise wait for 2.0.3

vigoo avatar Oct 17 '22 14:10 vigoo