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.
11#include <boost/algorithm/string.hpp>
12
13#include "Framework/InputSpec.h"
19#include "Framework/Logger.h"
20
21#include <chrono>
22#include <thread>
23
24using namespace o2::framework;
26
28{
29 return WorkflowSpec{
30 {"source",
31 Inputs{},
32 {
33 OutputSpec{{"test"}, "TST", "A"},
34 },
36 [](ProcessingContext& ctx) {
37 auto& out = ctx.outputs().make<int>(OutputRef{"test", 0});
38 ctx.services().get<ControlService>().endOfStream();
39 ctx.services().get<ControlService>().readyToQuit(QuitRequest::Me);
40 }}},
41 {"dest",
42 Inputs{
43 {"test", "TST", "A"}},
44 Outputs{},
46 [](InitContext& ic) {
47 auto count = std::make_shared<int>(0);
48 auto callback = [count](fair::mq::RegionInfo const&) {
49 LOG(info) << "once";
50 (*count)++;
51 };
52 fair::mq::RegionInfo dummy;
53 ic.services().get<CallbackService>().set<CallbackService::Id::RegionInfoCallback>(callback);
54 return [count](ProcessingContext& ctx) {
55 if (*count >= 1) {
56 ctx.services().get<ControlService>().readyToQuit(QuitRequest::All);
57 }
58 };
59 }}}};
60}
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"