James Charles
unread,May 12, 2021, 12:09:56 PM5/12/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redi...@googlegroups.com
Hi,
I use hiredis as the client. GET and SET are mixed in my input file.
For example, each SET is followed by a GET. I am trying to use
pipeline in hiredis to speed up. I want to put 100 commands together
and then send them to Redis in the pipeline. The line is the command
from my input file, when the first letter is S, it will need SET,
otherwise is GET. The implementation is below. I run the codes and
nothing is added to Redis. Any help would be appreciated.
while ((read = getline(&line, &len, fptr)) != -1)
{ count++;
if (count > 100)
{
freeReplyObject(reply);
count = 0;
}
if (line[0] == 'S')
{
redisAppendCommand(c, "SET %s %s", line, "valuekv");
}
else {
redisAppendCommand(c, "GET %s", line);
}
}