CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
subscriber_supervisor.cc
Go to the documentation of this file.
1 
6 
7 #include "subscriber.h"
8 #include "util/logging.h"
9 
10 namespace {
11 
14 
15 } // namespace
16 
17 namespace notify {
18 
20  int max_retries, uint64_t interval)
21  : Supervisor(max_retries, interval), subscriber_(s), topic_(t) {}
22 
24 
26  bool ret = subscriber_->Subscribe(topic_);
27  if (ret) {
28  LogCvmfs(
30  "SubscriberSupervisor - Subscription ended successfully. Stopping.");
31  } else {
33  "SubscriberSupervisor - Subscription failed. Retrying.");
34  }
35  return ret;
36 }
37 
38 } // namespace notify
SubscriberSupervisor(notify::Subscriber *s, std::string t, int max_retries, uint64_t interval)
const LogFacilities & kLogError
Definition: cmd_pub.cc:23
const LogFacilities & kLogInfo
Definition: cmd_pub.cc:22
virtual bool Subscribe(const std::string &topic)=0
LogFacilities
static LogFacilities info
static LogFacilities error
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)
Definition: logging.cc:528