mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 18:11:49 +00:00
Add DDS and Copy+Push examples.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
96cd2afac7
commit
105e734808
@@ -26,17 +26,18 @@ FairMQExample1Sink::FairMQExample1Sink()
|
||||
|
||||
void FairMQExample1Sink::Run()
|
||||
{
|
||||
while (GetCurrentState() == RUNNING)
|
||||
while (CheckCurrentState(RUNNING))
|
||||
{
|
||||
FairMQMessage* msg = fTransportFactory->CreateMessage();
|
||||
|
||||
fChannels.at("data-in").at(0).Receive(msg);
|
||||
if (fChannels.at("data-in").at(0).Receive(msg) > 0)
|
||||
{
|
||||
LOG(INFO) << "Received message: \""
|
||||
<< string(static_cast<char*>(msg->GetData()), msg->GetSize())
|
||||
<< "\"";
|
||||
|
||||
LOG(INFO) << "Received message: \""
|
||||
<< string(static_cast<char*>(msg->GetData()), msg->GetSize())
|
||||
<< "\"";
|
||||
|
||||
delete msg;
|
||||
delete msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
8
fairmq/examples/1-sampler-sink/README.md
Normal file
8
fairmq/examples/1-sampler-sink/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
Example 1: Sampler -> Sink
|
||||
===============
|
||||
|
||||
A simple topology of two devices - **Sampler** and **Sink**. **Sampler** sends data to **Sink** via the **PUSH-PULL** pattern.
|
||||
|
||||
`runExample1Sampler.cxx` and `runExample1Sink.cxx` configure and run the devices in their main function.
|
||||
|
||||
The executables take two required command line parameters: `--id` and `--config-json-file`. The value of `--id` should be a unique identifier and the value for `-config-json-file` a path to a config file. The config file for this example is `ex1-sampler-sink.json` and it contains configuration for the communication channels of the devices. The mapping between a specific device and the configuration (which can contain multiple devices) is done based on the **id**.
|
@@ -6,7 +6,7 @@
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
/**
|
||||
* runExampleSampler.cxx
|
||||
* runExample1Sampler.cxx
|
||||
*
|
||||
* @since 2013-04-23
|
||||
* @author D. Klein, A. Rybalchenko
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
/**
|
||||
* runExampleSink.cxx
|
||||
* runExample1Sink.cxx
|
||||
*
|
||||
* @since 2013-04-23
|
||||
* @author D. Klein, A. Rybalchenko
|
||||
|
Reference in New Issue
Block a user