mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-14 09:06:47 +00:00
Fix SDK topology shutdown to include unsubscribe
This commit is contained in:
parent
8789664cfd
commit
be022cfab8
|
@ -234,6 +234,11 @@ void DDSSession::SubscribeToCommands(std::function<void(const std::string& msg,
|
|||
// });
|
||||
}
|
||||
|
||||
void DDSSession::UnsubscribeFromCommands()
|
||||
{
|
||||
fImpl->fDDSCustomCmd.unsubscribe();
|
||||
}
|
||||
|
||||
void DDSSession::SendCommand(const std::string& cmd) { fImpl->fDDSCustomCmd.send(cmd, ""); }
|
||||
|
||||
auto operator<<(std::ostream& os, const DDSSession& session) -> std::ostream&
|
||||
|
|
|
@ -71,6 +71,7 @@ class DDSSession
|
|||
|
||||
void StartDDSService();
|
||||
void SubscribeToCommands(std::function<void(const std::string& msg, const std::string& condition, uint64_t senderId)>);
|
||||
void UnsubscribeFromCommands();
|
||||
void SendCommand(const std::string&);
|
||||
|
||||
friend auto operator<<(std::ostream& os, const DDSSession& session) -> std::ostream&;
|
||||
|
|
|
@ -182,6 +182,7 @@ void Topology::AddNewStateEntry(uint64_t senderId, const std::string& state)
|
|||
|
||||
Topology::~Topology()
|
||||
{
|
||||
fDDSSession.UnsubscribeFromCommands();
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(fMtx);
|
||||
fShutdown = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user