41 std::unique_ptr<ChunkMessengerInterface> messenger,
42 int keepalive_interval_sec,
43 int keepalive_interval_gap_sec,
44 std::unique_ptr<AnalyticsClientInterface> analytics_client);
47 ChunkMessengerInterface* Messenger()
const override;
49 AnalyticsClientInterface* AnalyticsClient()
const override;
55 const std::string& publication_id,
57 bool Unpublish(
const std::string& publication_id)
const override;
58 bool Unsubscribe(
const std::string& subscription_id)
const override;
68 void Dispose()
override;
72 std::vector<analytics::interface::AnalyticsClient::SubscriptionStats> GetSubscriptionStatsForAnalytics()
76 void UpdateMemberTtl(
int keepalive_interval_sec);
78 using SubscriptionId = std::string;
79 using SubscriptionPair =
80 std::pair<SubscriptionInterface*, interface::LocalPerson::SubscriptionOptions>;
82 std::unique_ptr<ChunkMessengerInterface> messenger_;
83 std::mutex tmp_subscriptions_mtx_;
84 std::unordered_map<SubscriptionId, SubscriptionPair> tmp_subscriptions_;
85 int keepalive_interval_sec_;
86 int keepalive_interval_gap_sec_;
88 std::unique_ptr<AnalyticsClientInterface> analytics_client_;
90 std::mutex stream_mtx_;
92 std::mutex disposed_mtx_;
93 std::condition_variable disposed_cv_;
95 std::unique_ptr<std::thread> ttl_timer_thread_;