| 143 | } |
| 144 | |
| 145 | void remote_subscription::set_client_state(const client_t _client, remote_subscription_state_e _state) { |
| 146 | std::scoped_lock its_lock(mutex_); |
| 147 | auto found_item = clients_.find(_client); |
| 148 | if (found_item != clients_.end()) { |
| 149 | found_item->second.first = _state; |
| 150 | if (found_item->second.second == std::chrono::steady_clock::time_point() |
| 151 | && (_state == remote_subscription_state_e::SUBSCRIPTION_ACKED || _state == remote_subscription_state_e::SUBSCRIPTION_NACKED)) { |
| 152 | found_item->second.second = std::chrono::steady_clock::now() + std::chrono::seconds(ttl_); |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | void remote_subscription::set_all_client_states(remote_subscription_state_e _state) { |
| 158 | std::scoped_lock its_lock(mutex_); |
no test coverage detected