Update multi-part features (nanomsg) and various fixes

- Implement nanomsg multipart with MessagePack.
 - Use the MessagePack from FairSoft and handle not found case.
 - Update splitter, merger and proxy devices to handle multi-part.
 - Let FairMQParts.At() return pointer reference (can be used for moving).
 - Add missing const specifier in the message interface.
 - Add transmit kernel size setting to channels (ZMQ_SNDBUF).
 - Remove FairMQBuffer device.
 - Remove old multi-part methods from Tutorial3 example (to be replaced with Parts API).
 - Make callback mandatory for newMsg(data, size, callback).
 - Add missing <vector> include in FairMQSocket.
This commit is contained in:
Alexey Rybalchenko
2016-03-21 09:59:00 +01:00
parent 4ca66e33da
commit 732373faa2
25 changed files with 436 additions and 381 deletions

View File

@@ -29,22 +29,12 @@ FairMQMerger::~FairMQMerger()
void FairMQMerger::Run()
{
// store the channel references to avoid traversing the map on every loop iteration
auto& dataInChannelRef = fChannels.at("data-in");
const FairMQChannel& dataOutChannel = fChannels.at("data-out").at(0);
int numInputs = dataInChannelRef.size();
std::vector<FairMQChannel*> dataInChannels(numInputs);
for (int i = 0; i < numInputs; ++i)
{
dataInChannels.at(i) = &(dataInChannelRef.at(i));
}
int numInputs = fChannels.at("data-in").size();
std::unique_ptr<FairMQPoller> poller(fTransportFactory->CreatePoller(dataInChannelRef));
std::unique_ptr<FairMQPoller> poller(fTransportFactory->CreatePoller(fChannels.at("data-in")));
while (CheckCurrentState(RUNNING))
{
std::unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
poller->Poll(100);
// Loop over the data input channels.
@@ -53,19 +43,19 @@ void FairMQMerger::Run()
// Check if the channel has data ready to be received.
if (poller->CheckInput(i))
{
// Try receiving the data.
if (dataInChannels[i]->Receive(msg) >= 0)
FairMQParts parts;
if (Receive(parts, "data-in", i) >= 0)
{
// If data was received, send it to output.
if (dataOutChannel.Send(msg) < 0)
if (Send(parts, "data-out") < 0)
{
LOG(DEBUG) << "Blocking send interrupted by a command";
LOG(DEBUG) << "Transfer interrupted";
break;
}
}
else
{
LOG(DEBUG) << "Blocking receive interrupted by a command";
LOG(DEBUG) << "Transfer interrupted";
break;
}
}