Project
Loading...
Searching...
No Matches
test_DanglingOutputs.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
15
16#include <chrono>
17#include <thread>
18#include <vector>
19
20using namespace o2::framework;
21
22AlgorithmSpec simplePipe(std::string const& what, int minDelay)
23{
24 return AlgorithmSpec{[what, minDelay](InitContext& ic) {
25 srand(getpid());
26 return [what, minDelay](ProcessingContext& ctx) {
27 auto& bData = ctx.outputs().make<int>(OutputRef{what}, 1);
28 };
29 }};
30}
31
32// a1 is not actually used by anything, however it might.
34{
35 return WorkflowSpec{
36 {"A",
37 Inputs{},
38 {OutputSpec{{"a1"}, "TST", "A1"},
39 OutputSpec{{"a2"}, "TST", "A2"}},
41 [](ProcessingContext& ctx) {
42 std::this_thread::sleep_for(std::chrono::milliseconds((rand() % 2 + 1) * 1000));
43 auto& aData1 = ctx.outputs().make<int>(OutputRef{"a1"}, 1);
44 auto& aData2 = ctx.outputs().make<int>(Output{"TST", "A2"}, 1);
45 ctx.services().get<ControlService>().endOfStream();
46 }}},
47 {"B",
48 {InputSpec{{"a1"}, "TST", "A1"}},
49 {},
51 [](ProcessingContext& ctx) {
52 }}}};
53}
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > Inputs
WorkflowSpec defineDataProcessing(ConfigContext const &specs)
This function hooks up the the workflow specifications into the DPL driver.
AlgorithmSpec simplePipe(std::string const &what, int minDelay)