| 532 | } |
| 533 | |
| 534 | void Server::PSubscribeChannel(const std::string &pattern, redis::Connection *conn) { |
| 535 | std::lock_guard<std::mutex> guard(pubsub_channels_mu_); |
| 536 | |
| 537 | auto conn_ctx = ConnContext(conn->Owner(), conn->GetFD()); |
| 538 | if (auto iter = pubsub_patterns_.find(pattern); iter == pubsub_patterns_.end()) { |
| 539 | pubsub_patterns_.emplace(pattern, std::list<ConnContext>{conn_ctx}); |
| 540 | } else { |
| 541 | iter->second.emplace_back(conn_ctx); |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | void Server::PUnsubscribeChannel(const std::string &pattern, redis::Connection *conn) { |
| 546 | std::lock_guard<std::mutex> guard(pubsub_channels_mu_); |
no test coverage detected