Add FairMQ Example 6 - Working with multiple channels

This commit is contained in:
Alexey Rybalchenko
2015-10-07 15:50:10 +02:00
parent 0b11ad9274
commit 023d88d0ef
20 changed files with 776 additions and 21 deletions

View File

@@ -39,6 +39,8 @@ void FairMQMerger::Run()
dataInChannels.at(i) = &(fChannels.at("data-in").at(i));
}
int numInputs = fChannels.at("data-in").size();
while (CheckCurrentState(RUNNING))
{
std::unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
@@ -46,7 +48,7 @@ void FairMQMerger::Run()
poller->Poll(100);
// Loop over the data input channels.
for (int i = 0; i < fChannels.at("data-in").size(); ++i)
for (int i = 0; i < numInputs; ++i)
{
// Check if the channel has data ready to be received.
if (poller->CheckInput(i))