Abstract out change listener from controller itself to permit DBs to shadow changes from other DBs.
This commit is contained in:
parent
c8c33db1d1
commit
f6b080b8a2
10 changed files with 88 additions and 74 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue