Skip to content

Commit 3100572

Browse files
authored
Generalise CompletionPolicy callback to allow for refactoring (#2074)
I will soon move to pass a DataProcessorSpec, rather than a DeviceSpec, because the completion policy is a property of the former. This will allow detecting consumeWhenAny policies early enough and make dataprocessors associated to it be resilient to expendable devices and Sporadic inputs.
1 parent ebf143d commit 3100572

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

Framework/src/AggregatorRunnerFactory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ DataProcessorSpec AggregatorRunnerFactory::create(const core::CommonSpec& common
5656
// Specify a custom policy to trigger whenever something arrive regardless of the timeslice.
5757
void AggregatorRunnerFactory::customizeInfrastructure(std::vector<framework::CompletionPolicy>& policies)
5858
{
59-
auto matcher = [label = AggregatorRunner::getLabel()](framework::DeviceSpec const& device) {
59+
auto matcher = [label = AggregatorRunner::getLabel()](auto const& device) {
6060
return std::find(device.labels.begin(), device.labels.end(), label) != device.labels.end();
6161
};
6262
policies.emplace_back(CompletionPolicyHelpers::consumeWhenAny("aggregatorRunnerCompletionPolicy", matcher));

Framework/src/CheckRunnerFactory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ DataProcessorSpec CheckRunnerFactory::createSinkDevice(const CheckRunnerConfig&
6767

6868
void CheckRunnerFactory::customizeInfrastructure(std::vector<framework::CompletionPolicy>& policies)
6969
{
70-
auto matcher = [label = CheckRunner::getCheckRunnerLabel()](framework::DeviceSpec const& device) {
70+
auto matcher = [label = CheckRunner::getCheckRunnerLabel()](auto const& device) {
7171
return std::find(device.labels.begin(), device.labels.end(), label) != device.labels.end();
7272
};
7373
policies.emplace_back(CompletionPolicyHelpers::consumeWhenAny("checkerCompletionPolicy", matcher));

Framework/src/RootFileSink.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RootFileSink::RootFileSink(std::string filePath)
4040

4141
void RootFileSink::customizeInfrastructure(std::vector<framework::CompletionPolicy>& policies)
4242
{
43-
auto matcher = [label = RootFileSink::getLabel()](framework::DeviceSpec const& device) {
43+
auto matcher = [label = RootFileSink::getLabel()](auto const& device) {
4444
return std::find(device.labels.begin(), device.labels.end(), label) != device.labels.end();
4545
};
4646

Framework/src/TaskRunnerFactory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ InputSpec TaskRunnerFactory::createTimerInputSpec(const CommonSpec& globalConfig
195195

196196
void TaskRunnerFactory::customizeInfrastructure(std::vector<framework::CompletionPolicy>& policies)
197197
{
198-
auto matcher = [label = TaskRunner::getTaskRunnerLabel()](framework::DeviceSpec const& device) {
198+
auto matcher = [label = TaskRunner::getTaskRunnerLabel()](auto const& device) {
199199
return std::find(device.labels.begin(), device.labels.end(), label) != device.labels.end();
200200
};
201201
auto callback = TaskRunner::completionPolicyCallback;

Framework/test/testCheckWorkflow.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void customize(std::vector<CompletionPolicy>& policies)
3030
DataSampling::CustomizeInfrastructure(policies);
3131
quality_control::customizeInfrastructure(policies);
3232

33-
auto matcher = [](framework::DeviceSpec const& device) {
33+
auto matcher = [](auto const& device) {
3434
return device.name.find(receiverName) != std::string::npos;
3535
};
3636

0 commit comments

Comments
 (0)