Implement Redis#HMGET and Redis#HMSET #58

Merged
merged 1 commit into from Aug 11, 2016

Projects

None yet

3 participants

@udzura udzura commented on an outdated diff Aug 9, 2016
src/mrb_redis.c
+ const char *argv[argc];
+ size_t argvlen[argc];
+ argv[0] = "HMGET";
+ argvlen[0] = sizeof("HMGET") - 1;
+
+ for (mrb_int argc_current = 1; argc_current < argc; argc_current++) {
+ mrb_value curr = mrb_str_to_str(mrb, mrb_argv[argc_current - 1]);
+ argv[argc_current] = RSTRING_PTR(curr);
+ argvlen[argc_current] = RSTRING_LEN(curr);
+ }
+
+ redisContext *rc = DATA_PTR(self);
+ redisReply *rr;
+ mrb_value array = mrb_nil_value();
+
+ rr = redisCommandArgv(rc, argc, argv, argvlen);
@udzura
udzura Aug 9, 2016

What will happen when redisCommandArgv returned error?

@hfm hfm changed the title from Implement Redis#HMGET and Redis#HMSET to [wip] Implement Redis#HMGET and Redis#HMSET Aug 10, 2016
@hfm hfm changed the title from [wip] Implement Redis#HMGET and Redis#HMSET to Implement Redis#HMGET and Redis#HMSET Aug 10, 2016
@matsumotory matsumotory merged commit 3bfb6eb into matsumotory:master Aug 11, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@matsumotory
Owner

Thanks!

@hfm hfm deleted the hfm:hmget-hmset branch Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment