FairMQ/examples/MQ/2-sampler-processor-sink
Alexey Rybalchenko 7ab6afa28a Remove compile time transport interface switch
- Remove the compile time check of the transport implementation.
  The transport (zeromq/nanomsg) can be chosen at run time with:
  `device.SetTransport("zeromq"); // possible values are "zeromq" and "nanomsg"`.

  For devices that use FairMQProgOptions, the transport can be configured via cmd option:
  `--transport zeromq` or `--transport nanomsg`. Default values is "zeromq".
  The device receives the configured value with:
  `device.SetTransport(config.GetValue<std::string>("transport"));`

  Old method of setting transport still works. But the NANOMSG constant is not defined.

- Remove old `fairmq/prototest` directory. It was only used as a test for protobuf.
  The protobuf part of Tutorial3 does the same (with different values).

- Fix a bug in FairMQPollerNN, where the `revents` value was not initialized.
  This caused the `poller->CheckOutput()` to trigger when it should not.
2018-05-02 16:12:57 +02:00
..
CMakeLists.txt Remove compile time transport interface switch 2018-05-02 16:12:57 +02:00
ex2-sampler-processor-sink.json Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
FairMQExample2Processor.cxx Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
FairMQExample2Processor.h Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
FairMQExample2Sampler.cxx Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
FairMQExample2Sampler.h Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
FairMQExample2Sink.cxx Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
FairMQExample2Sink.h Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
README.md Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
runExample2Processor.cxx Remove compile time transport interface switch 2018-05-02 16:12:57 +02:00
runExample2Sampler.cxx Remove compile time transport interface switch 2018-05-02 16:12:57 +02:00
runExample2Sink.cxx Remove compile time transport interface switch 2018-05-02 16:12:57 +02:00

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.