Adds HSCAN key/value support to storage.redisIterator#392
Adds HSCAN key/value support to storage.redisIterator#392frairon merged 2 commits intolovoo:masterfrom
Conversation
The HSCAN result gives us a 1-dimensional array with [n] == key, [n+1] == value so we take advantage of that in the iterator.
|
@frairon 👋 |
|
Hey @chrisfjones , One question out of curiosity: what's your use case for |
|
@frairon 👋 My use case for One of our use cases goes something like this (not exact, but it should illuminate the usage of goka): To accomplish this in goka, we've done the following:
This would work great on its own except for the case where the user types a few characters and then leaves the document. In this case, the "session" will remain open for that key until someone else decides to come in and type in the doc again. We chose to handle this case with
Furthermore, we are using Apologies for the tome 😄 and thanks for your time! Hopefully that makes sense. I'm 99% certain this solution is overkill and there is a much simpler way to accomplish this, so I'd be anxious to hear of any alternatives. Cheers! |
|
p.s. I've just now discovered #99 (a little late to the party 😅) and it looks like they're trying to accomplish a similar thing. I'll cross reference the above comment over there and would be happy to provide more detail on our solution. |
|
the two failing tests seem unrelated, let's merge this and fix the tests separately |
The HSCAN result gives us a 1-dimensional array with [n] == key, [n+1] == value so we take advantage of that in the redisIterator.
FWIW We've been running this in production for the past 2 weeks with no issues. Before this change we were chugging through unexpected keys in
VisitAll. Most of them were the values being passed as keys, a handful were the offset values (one per partition). After this change, we are onlyVisiting the expected keys.