Use Array to return all replies

This commit is contained in:
fbraem 2015-10-26 20:27:53 +01:00
parent 76905b426a
commit 2017e937a6
2 changed files with 6 additions and 6 deletions

View File

@ -122,14 +122,15 @@ public:
else throw BadCastException();
}
void sendCommands(const std::vector<Array>& commands,
std::vector<RedisType::Ptr>& results);
void sendCommands(const std::vector<Array>& commands, Array& results);
/// Sends all commands (pipelining) to the Redis server before
/// getting all replies.
void writeCommand(const Array& command);
/// Sends a request to the Redis server. Use readReply to get the
/// answer.
/// answer. Can also be used for pipelining commands. Make sure you
/// call readReply as many times as you called writeCommand, even when
/// an error occurred on a command.
private:

View File

@ -107,7 +107,7 @@ RedisType::Ptr Client::sendCommand(const Array& command)
return readReply();
}
void Client::sendCommands(const std::vector<Array>& commands, std::vector<RedisType::Ptr>& results)
void Client::sendCommands(const std::vector<Array>& commands, Array& results)
{
for(std::vector<Array>::const_iterator it = commands.begin(); it != commands.end(); ++it)
{
@ -116,8 +116,7 @@ void Client::sendCommands(const std::vector<Array>& commands, std::vector<RedisT
for(int i = 0; i < commands.size(); ++i)
{
RedisType::Ptr result = readReply();
results.push_back(result);
results.add(readReply());
}
}