From 6aa7e4c37a70709e7348bd16407c5983a563ed76 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期一, 29 三月 2021 21:11:34 +0800
Subject: [PATCH] test pub/sub msg; fix update last_time;

---
 src/pubsub.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/pubsub.h b/src/pubsub.h
index 0628216..c1f98af 100644
--- a/src/pubsub.h
+++ b/src/pubsub.h
@@ -23,18 +23,24 @@
 #include <atomic>
 #include <mutex>
 #include <vector>
+#include <unordered_map>
+#include <set>
 
 namespace bhome_shm {
 
 // publish/subcribe manager.
 class BusManager
 {
+    SharedMemory &shm_;
     ShmMsgQueue busq_;
     std::atomic<bool> run_;
     std::vector<std::thread> workers_;
     std::mutex mutex_;
+    typedef std::set<MQId> Clients;
+    std::unordered_map<std::string, Clients> records_;
 
     bool StopNoLock();
+    void OnMsg(const BHMsg &msg);
 public:
     BusManager(SharedMemory &shm);
     ~BusManager();

--
Gitblit v1.8.0