diff --git a/examples/dds/Sampler.cxx b/examples/dds/Sampler.cxx index bc4e39b2..7e0a8a02 100644 --- a/examples/dds/Sampler.cxx +++ b/examples/dds/Sampler.cxx @@ -46,8 +46,6 @@ bool Sampler::ConditionalRun() return false; } - this_thread::sleep_for(chrono::seconds(5)); - if (fIterations > 0) { ++fCounter; if (fCounter >= fIterations) { diff --git a/fairmq/StateMachine.cxx b/fairmq/StateMachine.cxx index 4201d075..6158b240 100644 --- a/fairmq/StateMachine.cxx +++ b/fairmq/StateMachine.cxx @@ -141,7 +141,7 @@ struct Machine_ : public state_machine_def Row, Row, - Row> {}; + Row> {}; void CallStateChangeCallbacks(const State state) const { diff --git a/fairmq/sdk/DDSSession.cxx b/fairmq/sdk/DDSSession.cxx index 2e2f4154..6840a745 100644 --- a/fairmq/sdk/DDSSession.cxx +++ b/fairmq/sdk/DDSSession.cxx @@ -227,7 +227,11 @@ void DDSSession::StartDDSService() { fImpl->fDDSService.start(fImpl->fId); } void DDSSession::SubscribeToCommands(std::function cb) { + fImpl->fSession.unsubscribe(); // TODO REMOVE THIS HACK!!!! fImpl->fDDSCustomCmd.subscribe(cb); + fImpl->fDDSCustomCmd.subscribeOnReply([](const std::string& reply) { + LOG(debug) << reply; + }); } void DDSSession::SendCommand(const std::string& cmd) { fImpl->fDDSCustomCmd.send(cmd, ""); } diff --git a/fairmq/sdk/Topology.cxx b/fairmq/sdk/Topology.cxx index a1129232..338167cf 100644 --- a/fairmq/sdk/Topology.cxx +++ b/fairmq/sdk/Topology.cxx @@ -65,6 +65,7 @@ Topology::Topology(DDSTopology topo, DDSSession session) std::vector deviceList = fDDSTopo.GetDeviceList(); for (const auto& d : deviceList) { + LOG(info) << "fair::mq::Topology Adding device " << d; fTopologyState.emplace(d, DeviceStatus{ false, DeviceState::Ok }); } fDDSSession.SubscribeToCommands([this](const std::string& msg, const std::string& condition, uint64_t senderId) { diff --git a/test/sdk/_topology.cxx b/test/sdk/_topology.cxx index 0ff1a3b1..a544943f 100644 --- a/test/sdk/_topology.cxx +++ b/test/sdk/_topology.cxx @@ -18,21 +18,21 @@ using Topology = fair::mq::test::TopologyFixture; TEST_F(Topology, Construction) { - fair::mq::sdk::Topology topo(mDDSTopo, mDDSSession); + fair::mq::sdk::Topology topo(mDDSTopo, mDDSSession); } TEST_F(Topology, ChangeState) { - using fair::mq::sdk::Topology; - using fair::mq::sdk::TopologyTransition; + using fair::mq::sdk::Topology; + using fair::mq::sdk::TopologyTransition; - Topology topo(mDDSTopo, mDDSSession); - fair::mq::tools::Semaphore blocker; - topo.ChangeState(TopologyTransition::Stop, [&](Topology::ChangeStateResult result) { - LOG(info) << result; - blocker.Signal(); - }); - blocker.Wait(); + Topology topo(mDDSTopo, mDDSSession); + fair::mq::tools::Semaphore blocker; + topo.ChangeState(TopologyTransition::Stop, [&](Topology::ChangeStateResult result) { + LOG(info) << result; + blocker.Signal(); + }); + blocker.Wait(); } } // namespace