-
Notifications
You must be signed in to change notification settings - Fork 179
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
Memcache auto discovery #548
base: master
Are you sure you want to change the base?
Conversation
960faab
to
ea2e6da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea looks good a few inline comments plus, unit test coverage and updated docs (including the changelog) would be great.
Thank you for the contribution, and sorry for the slow review.
@@ -1030,6 +1030,15 @@ def flush_all(self, delay: int = 0, noreply: Optional[bool] = None) -> bool: | |||
return True | |||
return results[0] == b"OK" | |||
|
|||
def auto_discover(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this command useful in the base client, where I assume we only have a single memcache ip port tuple, or is this only useful in the hash client? If only Hashclient lets move it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experience, it makes a sense to utilize HashClient
alongside it, as it allows for connecting to multiple nodes simultaneously or you can connect to cache cluster with Client
by using configuration node, ex. mycluster.fnjyzo.cfg.use1.cache.amazonaws.com
.
As I saw here's not much activity for half year, but I would be happy with support of this feature for one of mine project. Could I handle it if nobody mind?
pymemcache/client/hash.py
Outdated
): | ||
""" | ||
Constructor. | ||
|
||
Args: | ||
servers: list() of tuple(hostname, port) or string containing a UNIX | ||
socket path. | ||
If enable_auto_discovery is set, just a configuration endpoint would suffice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to point out this is an AWS elasticache specific feature
ea2e6da
to
0fe0600
Compare
In Hash client, if instead of a list of nodes, just cluster configuration endpoint is passed , This adds an option to fetch nodes from the endpoint
Resolves #534