Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

Handle key redirects (support cluster operations) #190

Open
geiseri opened this issue Jul 25, 2018 · 0 comments
Open

Handle key redirects (support cluster operations) #190

geiseri opened this issue Jul 25, 2018 · 0 comments

Comments

@geiseri
Copy link

geiseri commented Jul 25, 2018

I am trying to work with a cluster configuration, but my code is getting complicated fast when I try to handle key redirects for other cluster hosts. Right now I have to perform the operation, and then check to see if the reply was an error type and then parse the string for the MOVED, or ASK contents, and finally do the connection to the new host/port and submit the query.

Now I understand that because everything is async that making the connection to the new server is probably not easy. If at least there was a reply type of redirect that might make things easier to handle. It would at least remove the parsing step.

One other approach might be adding a callback for the -ASK/-MOVED errors that can update an LRU cache of connections related to those keys. Either way, it seems dealing with the responses on every command invocation response is quite painful as is.

That being said, if I am "doing it wrong" please suggest a more practical approach.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant