Skip to content

Refactor client overloads #7880

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 2 commits into from
Aug 9, 2023
Merged

Refactor client overloads #7880

merged 2 commits into from
Aug 9, 2023

Conversation

stevejgordon
Copy link
Contributor

  • Simplify overloads and avoid repeated code
  • Ensure we pass the cancellation token to transport

We had a chunk of repeated code which was hard to keep in sync. As these are all internal methods, I've restructured the overloads and removed a redundant one. Currently, we don't use the forceConfiguration overload, which we should probably review and either remove those overloads or reintroduce NEST force config behaviour.

This also fixes a bug where we don't always pass the cancellation token on transport calls making it impossible for some requests to be cooperatively cancelled.

Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

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

LGTM! Nice refactoring, thanks!

@flobernd flobernd added the 8.x Relates to a 8.x client version label Aug 9, 2023
@flobernd flobernd merged commit c09b49a into main Aug 9, 2023
@flobernd flobernd deleted the refactor-client-overloads branch August 9, 2023 10:40
github-actions bot pushed a commit that referenced this pull request Aug 9, 2023
* Simplify overloads and avoid repeated code

* Ensure we pass cancellation token to transport
flobernd pushed a commit that referenced this pull request Aug 9, 2023
* Simplify overloads and avoid repeated code

* Ensure we pass cancellation token to transport

Co-authored-by: Steve Gordon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants