void SubscriberImpl::unsubscribe(const std::string& topic, const std::string& subscriberId) { SyncOperationCallback* cb = new SyncOperationCallback(client->getConfiguration().getInt(Configuration::SYNC_REQUEST_TIMEOUT, DEFAULT_SYNC_REQUEST_TIMEOUT)); OperationCallbackPtr callback(cb); asyncUnsubscribe(topic, subscriberId, callback); cb->wait(); cb->throwExceptionIfNeeded(); }
void SubscriberImpl::subscribe(const std::string& topic, const std::string& subscriberId, const SubscriptionOptions& options) { SyncOperationCallback* cb = new SyncOperationCallback( channelManager->getConfiguration().getInt(Configuration::SYNC_REQUEST_TIMEOUT, DEFAULT_SYNC_REQUEST_TIMEOUT)); OperationCallbackPtr callback(cb); asyncSubscribe(topic, subscriberId, options, callback); cb->wait(); cb->throwExceptionIfNeeded(); }