46 using Logger = natter::logging::LoggerPtr;
49 const Config &config, LoggerPtr logger);
52 void subscribe(
const std::string &topic)
override;
53 void unsubscribe(
const std::string &topic)
override;
56 bool canStop()
const override;
59 void waitForResults(
const std::string &topic);
60 void joinMinhton(minhton::FindResult result,
const std::string &topic,
61 const std::vector<minhton::Logger::LoggerPtr> &logger);
64 void getResult(
const std::string &topic,
const std::function<
void()> &on_result);
65 void checkTopicJoin(
const std::string &topic,
bool should_exist);
69 std::unique_ptr<natter::minhcast::NatterMinhcast> minhcast_;
71 using Minhton = std::unique_ptr<minhton::Minhton>;
72 using Topic = std::string;
73 using MinhtonFuture = std::future<minhton::FindResult>;
75 std::unordered_map<Topic, MinhtonFuture> result_;
77 struct MinhtonTopicLogger {
79 std::vector<minhton::Logger::LoggerPtr> logger;
82 std::vector<MinhtonTopicLogger> minhton_loggers_;
84 std::unordered_map<Topic, Minhton> topic_trees_;
85 std::unordered_map<Info, uint32_t> peers_added_natter_;
86 std::shared_ptr<Storage> storage_;
88 bool stopping_ =
false;