Project
Loading...
Searching...
No Matches
test_RegionInfoCallbackService.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#include "Framework/Logger.h"
16
17using namespace o2::framework;
19
21{
22 return WorkflowSpec{
23 {"source",
24 Inputs{},
25 {
26 OutputSpec{{"test"}, "TST", "A"},
27 },
29 [](ProcessingContext& ctx) {
30 auto& out = ctx.outputs().make<int>(OutputRef{"test", 0});
31 ctx.services().get<ControlService>().endOfStream();
32 ctx.services().get<ControlService>().readyToQuit(QuitRequest::Me);
33 }}},
34 {"dest",
35 Inputs{
36 {"test", "TST", "A"}},
37 Outputs{},
39 [](InitContext& ic) {
40 auto count = std::make_shared<int>(0);
41 auto callback = [count](fair::mq::RegionInfo const&) {
42 LOG(info) << "once";
43 (*count)++;
44 };
45 fair::mq::RegionInfo dummy;
46 ic.services().get<CallbackService>().set<CallbackService::Id::RegionInfoCallback>(callback);
47 return [count](ProcessingContext& ctx) {
48 if (*count >= 1) {
49 ctx.services().get<ControlService>().readyToQuit(QuitRequest::All);
50 }
51 };
52 }}}};
53}
GLint GLsizei count
Definition glcorearb.h:399
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
the main header struct
Definition DataHeader.h:618
WorkflowSpec defineDataProcessing(ConfigContext const &)
This function hooks up the the workflow specifications into the DPL driver.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"