Skip to content

feat: add closeFactory/closeClient parameter to usingClient/usingDefaultClient - #2978

Open
mmustafasenoglu wants to merge 1 commit into
softwaremill:masterfrom
mmustafasenoglu:feat/closefactory-param
Open

feat: add closeFactory/closeClient parameter to usingClient/usingDefaultClient#2978
mmustafasenoglu wants to merge 1 commit into
softwaremill:masterfrom
mmustafasenoglu:feat/closefactory-param

Conversation

@mmustafasenoglu

Copy link
Copy Markdown
Contributor

The usingClient and usingDefaultClient factory methods on Armeria and OkHttp backends hardcoded closeFactory/closeClient to false, giving users no way to have the backend close a user-provided client.

This adds an optional closeFactory/closeClient: Boolean = false parameter to all public factory methods, allowing users to control whether the backend should close the underlying client on backend.close().

Armeria backends (9 files):

  • ArmeriaCatsBackend (CE3 + CE2)
  • ArmeriaFutureBackend
  • ArmeriaFs2Backend (CE3 + CE2)
  • ArmeriaZioBackend (ZIO 2 + ZIO 1)
  • ArmeriaMonixBackend
  • ArmeriaScalazBackend

OkHttp backends (2 files):

  • OkHttpSyncBackend
  • OkHttpFutureBackend

Closes #2628

…ultClient

The usingClient and usingDefaultClient factory methods on Armeria and
OkHttp backends hardcoded closeFactory/closeClient to false, giving
users no way to have the backend close a user-provided client.

This adds an optional closeFactory/closeClient: Boolean = false parameter
to all public factory methods, allowing users to control whether the
backend should close the underlying client on backend.close().

Armeria backends (9 files):
- ArmeriaCatsBackend (CE3 + CE2)
- ArmeriaFutureBackend
- ArmeriaFs2Backend (CE3 + CE2)
- ArmeriaZioBackend (ZIO 2 + ZIO 1)
- ArmeriaMonixBackend
- ArmeriaScalazBackend

OkHttp backends (2 files):
- OkHttpSyncBackend
- OkHttpFutureBackend

Closes softwaremill#2628
Copilot AI lite review requested due to automatic review settings August 24, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@adamw

adamw commented Aug 25, 2026

Copy link
Copy Markdown
Member

Thanks - although compilation fails in a number of cases

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

Successfully merging this pull request may close these issues.

Confusing ArmeriaCatsBackend initialization

3 participants