Initialize all data members in initializer lists. Reorder data members in initializer list to have the same order as in the class declaration. Comment or remove unused parameters and unused variables. Convert all old style casts to the correct and explicit c++ cast like const_cast, static_cast, dynamic_cast or reinterpret_cast. In most cases static_cast is used. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
ex2-sampler-processor-sink.json | ||
FairMQExample2Processor.cxx | ||
FairMQExample2Processor.h | ||
FairMQExample2Sampler.cxx | ||
FairMQExample2Sampler.h | ||
FairMQExample2Sink.cxx | ||
FairMQExample2Sink.h | ||
README.md | ||
runExample2Processor.cxx | ||
runExample2Sampler.cxx | ||
runExample2Sink.cxx |
Example 2: Sampler -> Processor -> Sink
A simple topology of three devices - Sampler, Processor and Sink. Sampler sends data to one or more Processors, who modify the data and send it to one Sink. Transport with the PUSH-PULL pattern.
In this example the Sampler is configured to bind its output and the Sink is configured to also bind its input. This allows us run any number of processors with the same configuration, because they all connect to same Sampler and Sink addresses. Furthermore, it allows adding of processors dynamically during run-time. The PUSH and PULL sockets will handle the data distribution to/from the new devices according to their distribution strategies (Round-robin output for PUSH and Fair-queued input for PULL).
The Sampler sends out a simple text string (its content configurable with --text
command line parameter, defaul is "Hello"). Each Processor modifies the string by appending its ID to it and send it to the Sink.
The provided configuration file contains two Processors. To add more Processors, you can either extend the configuration file, or create a separate file only for new processors.