From 101b5cf85397ef9350aaedd12cfcf9fd3d07a565 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期四, 20 五月 2021 12:41:51 +0800
Subject: [PATCH] refactor node center.
---
src/defs.h | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/defs.h b/src/defs.h
index cc3dc02..51040e6 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -19,6 +19,7 @@
#ifndef DEFS_KP8LKGD0
#define DEFS_KP8LKGD0
+#include "robust.h"
#include <atomic>
#include <string>
@@ -35,8 +36,8 @@
struct CenterInfo {
MQInfo mq_center_;
MQInfo mq_bus_;
- MQInfo mq_init_;
MQInfo mq_sender_;
+ robust::AtomicReqRep init_rr_;
std::atomic<MQId> mqid_;
CenterInfo() :
mqid_(100000) {}
@@ -62,6 +63,10 @@
const MQInfo &BHGlobalSenderAddress();
const MQInfo &BHTopicCenterAddress();
const MQInfo &BHTopicBusAddress();
-const MQInfo &BHCenterReplyAddress();
+bool BHNodeInit(const int64_t request, int64_t &reply);
+void BHCenterHandleInit(std::function<int64_t(const int64_t)> const &onReq);
+
+// node mq is avail with in timeout; after that may get killed.
+int NodeTimeoutSec();
#endif // end of include guard: DEFS_KP8LKGD0
--
Gitblit v1.8.0