Skip to content

[http-client] Make clients AutoCloseable #512

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

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

SentryMan
Copy link
Collaborator

Since JDK 21, java.net.HttpClient now extends AutoCloseable, should we not follow suit?

  • io.avaje.http.client.HttpClient now extends AutoCloseable (has no effect unless on 21 or higher)
  • generated Client interface implementations will now additionally implement AutoClosable as well

@SentryMan SentryMan added the enhancement New feature or request label Nov 11, 2024
@SentryMan SentryMan added this to the 2.9 milestone Nov 11, 2024
@SentryMan SentryMan requested a review from rbygrave November 11, 2024 19:23
@SentryMan SentryMan self-assigned this Nov 11, 2024
@rbygrave
Copy link
Contributor

should we not follow suit?

Yes, I reckon we should. Nice spotting and nice work.

@rbygrave rbygrave merged commit 078d250 into avaje:master Nov 14, 2024
6 checks passed
@SentryMan SentryMan deleted the auto-close branch November 14, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants