Skip to content
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

loadblancer: HostSelector List variance #2795

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

bryce-anderson
Copy link
Contributor

Motivation:

The HostSelector currently operates on a List which doesn't allow us to pass in lists of refined types. This means we need to make copies of lists just to pass them through if implementations want to store the refined types.

Modifications:

  • Make the HostSelector operate on a List<? extends Host>. This continues to give implementations the ability to read the list entries, which is all it should do, while allowing users of the HostSelector to pass in a list of a refined type.

Motivation:

The HostSelector currently operates on a List<Host> which
doesn't allow us to pass in lists of refined types. This
means we need to make copies of lists just to pass them through
if implementations want to store the refined types.

Modifications:

- Make the HostSelector operate on a List<? extends Host>.
  This continues to give implementations the ability to read
  the list entries, which is all it should do, while allowing
  users of the HostSelector to pass in a list of a refined type.
@bryce-anderson bryce-anderson merged commit cb8405d into apple:main Jan 8, 2024
15 checks passed
@bryce-anderson bryce-anderson deleted the bl_anderson/list_variance branch January 8, 2024 18:41
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.

4 participants