Convert io_service_ from reference to smart pointer (#6285)

This commit is contained in:
mehrdadn
2019-11-29 16:09:46 -08:00
committed by Philipp Moritz
parent b8cfdba752
commit e28e464158
+3 -3
View File
@@ -89,19 +89,19 @@ class RedisCallbackManager {
: callback_(callback),
is_subscription_(is_subscription),
start_time_(start_time),
io_service_(io_service) {}
io_service_(&io_service) {}
void Dispatch(std::shared_ptr<CallbackReply> &reply) {
std::shared_ptr<CallbackItem> self = shared_from_this();
if (callback_ != nullptr) {
io_service_.post([self, reply]() { self->callback_(std::move(reply)); });
io_service_->post([self, reply]() { self->callback_(std::move(reply)); });
}
}
RedisCallback callback_;
bool is_subscription_;
int64_t start_time_;
boost::asio::io_service &io_service_;
boost::asio::io_service *io_service_;
};
int64_t add(const RedisCallback &function, bool is_subscription,