mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 22:56:19 +01:00
Use Array to return all replies
This commit is contained in:
parent
76905b426a
commit
2017e937a6
@ -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:
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user