-
Notifications
You must be signed in to change notification settings - Fork 36
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
Better support for working with XREADGROUP and XREAD replies #43
Comments
@anarthal You used Boost.Redis and streams in the boost-servertech, if you have any good idea on how to implement this case feel free to chime in. Thanks. |
@ashtum Are you still using the account you used to open this ticket? |
No, I don't have access to that. |
So something I've seen is that it's difficult to escape from What I'm trying to say is that I'd go down the path of making What I find difficult about So I'd suggest an alternative, tree-like structure, that offers you methods to retrieve each node's children, at least. Something like Boost.Json Other than that, each entry returned by
I've only seen attribute strings, idk if they can be of other types. But then the result of I suggest you to have a look at the TypeScript driver for node.js, since IIRC they include detailed type definitions for every command result - you can get some inspiration from this. |
Yes, it is too low level for the general public. We need two things
generic_response gresp;
...
error_code ec;
auto map = as<std::map<user, value>>(gresp-range, ec)
A tree would be the most generic thing, but too generic and therefore not very efficient for most cases. I believe most requests don't have a dynamic number of commands. |
Can't you just use
I'm proposing an additional, opt-in mechanism, not replacing |
Yes, that works too. I should indeed add this to the docs. There just should be a more elegant way of iterating over a generic_response than checking depths manually. |
XREADGROUP
andXREAD
replies have the same structure. if we usestd::vector< aedis::resp3::node< std::string > >
for their response it will be very difficult to work with their replies.It would be great if you could add some library support to make working with Redis streams easier.
The text was updated successfully, but these errors were encountered: