Skip to content

Commit 4dd515e

Browse files
committed
DPL: use RawDeviceService to sleep in example
FairMQ still has issues with system sleep...
1 parent f28e5f0 commit 4dd515e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Framework/TestWorkflows/src/o2DiamondWorkflow.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "Framework/ConfigParamSpec.h"
1111
#include "Framework/CompletionPolicyHelpers.h"
1212
#include "Framework/DeviceSpec.h"
13+
#include "Framework/RawDeviceService.h"
14+
#include <FairMQDevice.h>
1315
#include <InfoLogger/InfoLogger.hxx>
1416

1517
#include <chrono>
@@ -57,8 +59,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& specs)
5759
{OutputSpec{{"a1"}, "TST", "A1"},
5860
OutputSpec{{"a2"}, "TST", "A2"}},
5961
AlgorithmSpec{adaptStateless(
60-
[](DataAllocator& outputs, InfoLogger& logger) {
61-
std::this_thread::sleep_for(std::chrono::seconds(rand() % 2));
62+
[](DataAllocator& outputs, InfoLogger& logger, RawDeviceService& device) {
63+
device.device()->WaitFor(std::chrono::seconds(rand() % 2));
6264
auto& aData = outputs.make<int>(OutputRef{"a1"}, 1);
6365
auto& bData = outputs.make<int>(OutputRef{"a2"}, 1);
6466
logger.log("This goes to infologger");

0 commit comments

Comments
 (0)