Commit d2228844 authored by Georgios Bitzes's avatar Georgios Bitzes
Browse files

Add 'activate-push-types' command to indicate a client supports RESP3 push...

Add 'activate-push-types' command to indicate a client supports RESP3 push types - no effect for now
parent 6e9c0819
Pipeline #1030123 failed with stages
in 38 minutes and 1 second
......@@ -36,6 +36,7 @@ struct cmdMapInit {
redis_cmd_map["monitor"] = {RedisCommand::MONITOR, CommandType::CONTROL};
redis_cmd_map["client_id"] = {RedisCommand::CLIENT_ID, CommandType::CONTROL};
redis_cmd_map["command_stats"] = {RedisCommand::COMMAND_STATS, CommandType::CONTROL};
redis_cmd_map["activate_push_types"] = {RedisCommand::ACTIVATE_PUSH_TYPES, CommandType::CONTROL};
redis_cmd_map["auth"] = {RedisCommand::AUTH, CommandType::AUTHENTICATION};
redis_cmd_map["hmac_auth_generate_challenge"] = {RedisCommand::HMAC_AUTH_GENERATE_CHALLENGE, CommandType::AUTHENTICATION};
......
......@@ -36,6 +36,7 @@ enum class RedisCommand {
MONITOR,
CLIENT_ID,
COMMAND_STATS,
ACTIVATE_PUSH_TYPES,
FLUSHALL,
......
......@@ -175,6 +175,10 @@ LogIndex PendingQueue::dispatchPending(RedisDispatcher *dispatcher, LogIndex com
return -1;
}
void PendingQueue::activatePushTypes() {
supportsPushTypes = true;
}
size_t phantomBatchLimit = 100;
void Connection::setPhantomBatchLimit(size_t newval) {
......@@ -342,3 +346,7 @@ void Connection::flush() {
std::string Connection::describe() const {
return description;
}
void Connection::activatePushTypes() {
pendingQueue->activatePushTypes();
}
......@@ -77,6 +77,8 @@ public:
bool addMessageIfAttached(const std::string &channel, RedisEncodedResponse &&raw);
bool addPatternMessageIfAttached(const std::string &pattern, RedisEncodedResponse &&raw);
void activatePushTypes();
private:
LinkStatus appendResponseNoLock(RedisEncodedResponse &&raw);
Connection *conn;
......@@ -110,6 +112,7 @@ private:
LogIndex lastIndex = -1;
std::queue<PendingRequest> pending;
SubscriptionTracker subscriptionTracker;
bool supportsPushTypes = false;
};
//------------------------------------------------------------------------------
......@@ -186,6 +189,7 @@ public:
Connection *conn;
};
void activatePushTypes();
static void setPhantomBatchLimit(size_t newval);
private:
BufferedWriter writer;
......
......@@ -128,6 +128,10 @@ LinkStatus QuarkDBNode::dispatch(Connection *conn, RedisRequest &req) {
case RedisCommand::CLIENT_ID: {
return conn->status(conn->getID());
}
case RedisCommand::ACTIVATE_PUSH_TYPES: {
conn->activatePushTypes();
return conn->ok();
}
case RedisCommand::QUARKDB_INFO: {
return conn->statusVector(this->info().toVector());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment