FairMQ/examples/multipart
Matthias Richter 696257fd4f Extending FairMQParts by a constructor taking list of FairMQMessagePtr
This introduces a little helper to create a FairMQParts object in place from a
variable list of arguments. As a side effect also AddParts is extended to support
more than one FairMQMessagePtr.
2019-03-19 12:48:02 +01:00
..
CMakeLists.txt Extending FairMQParts by a constructor taking list of FairMQMessagePtr 2019-03-19 12:48:02 +01:00
ex-multipart-multiple-endpoints.json Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
fairmq-start-ex-multipart.sh.in provide location for general fairmq devices/tools 2018-05-02 16:12:57 +02:00
Header.h Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
README.md Update example READMEs 2018-05-02 16:12:57 +02:00
runSampler.cxx Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
runSink.cxx Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
Sampler.cxx Extending FairMQParts by a constructor taking list of FairMQMessagePtr 2019-03-19 12:48:02 +01:00
Sampler.h Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
Sink.cxx Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
Sink.h Refactor the examples after move from FairRoot 2018-05-02 16:12:57 +02:00
test-ex-multipart.sh.in Add session id to example tests 2018-10-11 17:06:39 +02:00

Sending Multipart messages

A topology of two devices - Sampler and Sink, communicating with PUSH-PULL pattern.

The Sampler sends a multipart message to the Sink, consisting of two message parts - header and body.

Each message part is a regular FairMQMessage. To combine them into a multi-part message use FairMQParts. Add messages to FairMQParts with AddPart method.

All parts are guaranteed to be delivered together. The Receive call in the sink will recive the entire parts structure.

The header contains a simple data structure with one integer. The integer in this structure is used as a stop flag for the sink. As long as its value is 0, the Sink will keep processing the data. Once its value is 1, the data handler method of the Sink will return false, which will exit the RUNNING state of the device.