Project
Loading...
Searching...
No Matches
test_SimpleTimer.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
19using namespace o2::framework;
20
21// This is how you can define your processing in a declarative way
22std::vector<DataProcessorSpec> defineDataProcessing(ConfigContext const&)
23{
24 return {
26 "enumeration",
27 Inputs{},
28 {},
30 adaptStateless([](ControlService& control) {
31 // This is invoked autonomously by the timer.
32 std::this_thread::sleep_for(std::chrono::seconds(1));
33 control.readyToQuit(QuitRequest::All);
34 })}},
36 "atimer",
37 Inputs{
38 InputSpec{"atimer", "TST", "TIMER", 0, Lifetime::Timer}},
39 {},
41 adaptStateless([](ControlService& control) {
42 // This is invoked autonomously by the timer.
43 control.readyToQuit(QuitRequest::Me);
44 })}},
46 "btimer",
47 Inputs{
48 InputSpec{"btimer", "TST", "TIMER2", 0, Lifetime::Timer}},
49 {},
51 adaptStateless([](ControlService& control) {
52 // This is invoked autonomously by the timer.
53 control.readyToQuit(QuitRequest::Me);
54 })},
55 {ConfigParamSpec{"period-btimer", VariantType::Int, 2000, {"period of timer"}}}}};
56}
void readyToQuit(bool all)
Compatibility with old API.
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
AlgorithmSpec::ProcessCallback adaptStateless(LAMBDA l)
std::vector< InputSpec > Inputs
std::vector< DataProcessorSpec > defineDataProcessing(ConfigContext const &)
This function hooks up the the workflow specifications into the DPL driver.