Abstract out change listener from controller itself to permit DBs to shadow changes from other DBs.

This commit is contained in:
Adam Ierymenko 2019-07-26 17:39:00 -07:00
parent c8c33db1d1
commit f6b080b8a2
10 changed files with 88 additions and 74 deletions

View file

@ -51,7 +51,7 @@ struct MQConfig;
class PostgreSQL : public DB
{
public:
PostgreSQL(EmbeddedNetworkController *const nc, const Identity &myId, const char *path, int listenPort, MQConfig *mqc = NULL);
PostgreSQL(const Identity &myId, const char *path, int listenPort, MQConfig *mqc = NULL);
virtual ~PostgreSQL();
virtual bool waitForReady();
@ -78,7 +78,6 @@ private:
void _networksWatcher_Postgres(PGconn *conn);
void _networksWatcher_RabbitMQ();
void commitThread();
void onlineNotificationThread();
@ -93,7 +92,6 @@ private:
BlockingQueue<nlohmann::json *> _commitQueue;
std::thread _heartbeatThread;
std::thread _membersDbWatcher;
std::thread _networksDbWatcher;
@ -116,4 +114,4 @@ private:
#endif // ZT_CONTROLLER_LIBPQ_HPP
#endif // ZT_CONTROLLER_USE_LIBPQ
#endif // ZT_CONTROLLER_USE_LIBPQ