/* static */ void ConsumeWriteCallback::timerComplete(const ClientImplPtr& client, const PubSubDataPtr& data, const boost::system::error_code& error) { if (error) { // shutting down return; } client->getSubscriberImpl().consume(data->getTopic(), data->getSubscriberId(), data->getMessageSeqId()); }
ActiveSubscriber::ActiveSubscriber(const PubSubDataPtr& data, const AbstractDuplexChannelPtr& channel, const SubscriptionPreferencesPtr& preferences, const DuplexChannelManagerPtr& channelManager) : channel(channel), deliverystate(STOPPED_DELIVERY), origData(data), preferences(preferences), channelManager(channelManager), should_wait(false) { LOG4CXX_DEBUG(logger, "Creating ActiveSubscriber " << this << " for (topic:" << data->getTopic() << ", subscriber:" << data->getSubscriberId() << ")."); }
void SubscriberImpl::doSubscribe(const DuplexChannelPtr& channel, const PubSubDataPtr& data, const SubscriberClientChannelHandlerPtr& handler) { channel->storeTransaction(data); OperationCallbackPtr writecb(new SubscriberWriteCallback(client, data)); channel->writeRequest(data->getRequest(), writecb); boost::lock_guard<boost::shared_mutex> lock(topicsubscriber2handler_lock); TopicSubscriber t(data->getTopic(), data->getSubscriberId()); SubscriberClientChannelHandlerPtr oldhandler = topicsubscriber2handler[t]; if (oldhandler != NULL) { oldhandler->handoverDelivery(handler); } topicsubscriber2handler[t] = handler; LOG4CXX_DEBUG(logger, "Set topic subscriber for topic(" << data->getTopic() << ") subscriberId(" << data->getSubscriberId() << ") to " << handler.get() << " topicsubscriber2topic(" << &topicsubscriber2handler << ")"); }