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

Support for module-based read-only commands #2401 #2447

Closed
wants to merge 1 commit into from

Conversation

JimB123
Copy link
Contributor

@JimB123 JimB123 commented Jul 13, 2023

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

Mark,

Looking for feedback on this. At this point, I've authored the code changes, but no unit/integration tests have been written.

A few questions:

  1. Is this what you were envisioning? If not, what needs to be improved?
  2. I'm not completely happy with the extraReadOnlyCommands. I'd really rather do something that also pulls in the standard read-only commands and combines the functionality directly. I also wasn't sure that this is what you were expecting.
  • I thought about overriding ClientOptions logic in the ClusterClientOptions to automatically pick up the cluster read-only commands - however from the existing code in ClusterDistributionChannelWriter (the constructor), it seems that we can't trust that the ClusterClientOptions is guaranteed to be used. I the end, I decided that some "extra" commands added in ClientOptions - with logic remaining the the channel writers was the most straightforward.
  1. What do we need in terms of test cases?
  2. I had to change some of the existing test cases, are these changes OK? Or is there a better way to alter them?

@mp911de mp911de added the type: feature A new feature label Jul 14, 2023
@mp911de mp911de self-assigned this Jul 14, 2023
@mp911de mp911de added this to the 6.2.5.RELEASE milestone Jul 17, 2023
@mp911de
Copy link
Collaborator

mp911de commented Jul 17, 2023

Thanks Jim.

I took a look and addressed

  1. I'm not completely happy with the extraReadOnlyCommands. I'd really rather do something that also pulls in the standard read-only commands and combines the functionality directly. I also wasn't sure that this is what you were expecting.

I'm pretty happy with the changes. With a bit of polishing we're quite there with a composable model to easily pick up default opinions and alter these or to let applications take full control over read-only routing.

mp911de pushed a commit that referenced this pull request Jul 17, 2023
mp911de added a commit that referenced this pull request Jul 17, 2023
Refactor Set of Commands into ReadOnlyPredicate to provide reusable components for predicate composition. Also allow override over Lettuce defaults.

Incorporate optimization of getIntent logic.

Original pull requests: #2447, #2442
mp911de pushed a commit that referenced this pull request Jul 17, 2023
mp911de added a commit that referenced this pull request Jul 17, 2023
Refactor Set of Commands into ReadOnlyPredicate to provide reusable components for predicate composition. Also allow override over Lettuce defaults.

Incorporate optimization of getIntent logic.

Original pull requests: #2447, #2442
@mp911de
Copy link
Collaborator

mp911de commented Jul 17, 2023

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants