Skip to content

Conversation

@Ivan-Montes
Copy link
Contributor

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:

@minwoox minwoox added this to the 1.33.0 milestone Apr 17, 2025
} finally {
nextConnectionPoolListener.connectionClosed(protocol, remoteAddr,localAddr,attrs);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question) What do you think of also calling close as well?

e.g.

@Override
public void close() {
    try {
        ConnectionPoolListener.super.close();
    } finally {
        nextConnectionPoolListener.close();
    }
}

On side note, I think we're missing a call to ConnectionPoolMetrics#close from MetricCollectingConnectionPoolListener; I think we'll fix that separately

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I'll implement that.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Ivan-Montes!

---

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
@Ivan-Montes Ivan-Montes force-pushed the feature/implement-dothen-method-in-connectionpoollistener branch from f23733e to dec0883 Compare April 17, 2025 06:43
@codecov
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.60%. Comparing base (8150425) to head (896c7a9).
Report is 74 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6207      +/-   ##
============================================
+ Coverage     74.46%   74.60%   +0.14%     
- Complexity    22234    22466     +232     
============================================
  Files          1963     1972       +9     
  Lines         82437    83003     +566     
  Branches      10764    10798      +34     
============================================
+ Hits          61385    61923     +538     
- Misses        15918    15936      +18     
- Partials       5134     5144      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

**Modifications:**

- In `ConnectionPoolListener`, implement `close` method within the `andThen` method.
- In `ConnectionPoolListener`, annotate the `andThen` method with `@UnstableApi`.
- In `ConnectionPoolListenerTest`, add `throws Exception` to the method signature
@Ivan-Montes Ivan-Montes force-pushed the feature/implement-dothen-method-in-connectionpoollistener branch from dec0883 to 896c7a9 Compare April 17, 2025 13:09
@Ivan-Montes
Copy link
Contributor Author

Thanks for the feedback! I've implemented the suggested changes. Please let me know if there's anything else that needs to be updated.

@jrhee17
Copy link
Contributor

jrhee17 commented May 12, 2025

ping @minwoox

Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Ivan-Montes 👍

@jrhee17 jrhee17 merged commit 47e4485 into line:main May 12, 2025
16 checks passed
@Ivan-Montes
Copy link
Contributor Author

Thanks, @Ivan-Montes 👍

Thank you team!!

@Ivan-Montes Ivan-Montes deleted the feature/implement-dothen-method-in-connectionpoollistener branch May 12, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ConnectionPoolListener.andThen(ConnectionPoolListener)

4 participants