mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
Use Array to return all replies
This commit is contained in:
@@ -122,14 +122,15 @@ public:
|
|||||||
else throw BadCastException();
|
else throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendCommands(const std::vector<Array>& commands,
|
void sendCommands(const std::vector<Array>& commands, Array& results);
|
||||||
std::vector<RedisType::Ptr>& results);
|
|
||||||
/// Sends all commands (pipelining) to the Redis server before
|
/// Sends all commands (pipelining) to the Redis server before
|
||||||
/// getting all replies.
|
/// getting all replies.
|
||||||
|
|
||||||
void writeCommand(const Array& command);
|
void writeCommand(const Array& command);
|
||||||
/// Sends a request to the Redis server. Use readReply to get the
|
/// 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:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ RedisType::Ptr Client::sendCommand(const Array& command)
|
|||||||
return readReply();
|
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)
|
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)
|
for(int i = 0; i < commands.size(); ++i)
|
||||||
{
|
{
|
||||||
RedisType::Ptr result = readReply();
|
results.add(readReply());
|
||||||
results.push_back(result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user