Implemented doThen method to chain ConnectionPoolListener - #5166
Implemented doThen method to chain ConnectionPoolListener#5166asontireddy wants to merge 1 commit into
Conversation
|
|
|
@trustin Can you please go through the changes I have made and let me know if I am going in the right direction? Also, the project is building fine locally but I am getting some errors when I run existing tests, Can you please help me resolve those errors, so that I can write a unit test for this change? |
|
Hi Guys, also I signed the CLA, but it is still showing as pending, Is there anything else that I need to do in that area so that action passes? |
Did you sign the CLA with the same email used for the commit? |
jrhee17
left a comment
There was a problem hiding this comment.
Thanks! Left some minor comments 👍
| return this; | ||
| } | ||
|
|
||
| default ConnectionPoolListener doThen(ConnectionPoolListener anotherConnectionPoolListener) { |
There was a problem hiding this comment.
| default ConnectionPoolListener doThen(ConnectionPoolListener anotherConnectionPoolListener) { | |
| default ConnectionPoolListener andThen(ConnectionPoolListener anotherConnectionPoolListener) { |
| return new ConnectionPoolListener() { | ||
| @Override | ||
| public void connectionOpen(SessionProtocol protocol, InetSocketAddress remoteAddr, InetSocketAddress localAddr, AttributeMap attrs) throws Exception { | ||
| anotherConnectionPoolListener.connectionOpen(protocol, remoteAddr, localAddr, attrs); |
There was a problem hiding this comment.
I think the expectation is that this#connectionOpen is called, and then anotherConnectionPoolListener#connectionOpen is called (hence "chained").
Can you also add a test to confirm this behavior?
| anotherConnectionPoolListener.connectionOpen(protocol, remoteAddr, localAddr, attrs); | |
| connectionOpen(protocol, remoteAddr, localAddr, attrs); | |
| anotherConnectionPoolListener.connectionOpen(protocol, remoteAddr, localAddr, attrs); |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5166 +/- ##
=========================================
Coverage 74.25% 74.25%
- Complexity 19825 19828 +3
=========================================
Files 1699 1699
Lines 73046 73052 +6
Branches 9357 9357
=========================================
+ Hits 54239 54245 +6
- Misses 14371 14374 +3
+ Partials 4436 4433 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @jrhee17, I would like to contribute to this solution if you agree. |
--- Related: line#5159 **Motivation:** Add `andThen` method to `ConnectionPoolListener` to chain more than one listener **Modifications:** - In `ConnectionPoolListener`, add `andThen` method. - In `ConnectionPoolListenerTest`, add test **Result:** - Closes line#5159 - Supersedes line#5166 This PR replaces the changes proposed in line#5166, which is now outdated. - Now, we could chain more than one listener
|
Let me close this PR since it's not updated and superseded by #6207 |
--- Related: line#5159 **Motivation:** Add `andThen` method to `ConnectionPoolListener` to chain more than one listener **Modifications:** - In `ConnectionPoolListener`, add `andThen` method. - In `ConnectionPoolListenerTest`, add test **Result:** - Closes line#5159 - Supersedes line#5166 This PR replaces the changes proposed in line#5166, which is now outdated. - Now, we could chain more than one listener
Related: #5159 **Motivation:** Add `andThen` method to `ConnectionPoolListener` to chain more than one listener **Modifications:** - In `ConnectionPoolListener`, add `andThen` method. - In `ConnectionPoolListenerTest`, add test **Result:** - Closes #5159 - Supersedes #5166 This PR replaces the changes proposed in #5166, which is now outdated. - Now, we could chain more than one listener
Motivation:
By implementing the doThen method, we can able to chain the ConnectionPoolListeners, which makes it easier to use
Modifications:
Result: