Skip to content

Commit

Permalink
DPL utils: allow customising output-proxy (#5165)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Jan 13, 2021
1 parent 94e0883 commit a73ec3c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Framework/Utils/src/dpl-output-proxy.cxx
Expand Up @@ -28,6 +28,14 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
ConfigParamSpec{
"dataspec", VariantType::String, "dpl-output-proxy:TST/CLUSTERS;dpl-output-proxy:TST/TRACKS", {"selection string for the data to be proxied"}});

workflowOptions.push_back(
ConfigParamSpec{
"output-proxy-method", VariantType::String, "bind", {"proxy socket method: bind, connect"}});

workflowOptions.push_back(
ConfigParamSpec{
"output-proxy-address", VariantType::String, "0.0.0.0", {"address to connect / bind to"}});

workflowOptions.push_back(
ConfigParamSpec{
"default-transport", VariantType::String, "shmem", {"default transport: shmem, zeromq"}});
Expand Down Expand Up @@ -65,8 +73,12 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
OutputChannelSpec externalChannelSpec;
externalChannelSpec.name = "downstream";
externalChannelSpec.type = ChannelType::Push;
externalChannelSpec.method = ChannelMethod::Bind;
externalChannelSpec.hostname = "localhost";
if (config.options().get<std::string>("output-proxy-method") == "bind") {
externalChannelSpec.method = ChannelMethod::Bind;
} else if (config.options().get<std::string>("output-proxy-method") == "connect") {
externalChannelSpec.method = ChannelMethod::Connect;
}
externalChannelSpec.hostname = config.options().get<std::string>("output-proxy-address");
externalChannelSpec.port = defaultPort;
externalChannelSpec.listeners = 0;
// in principle, protocol and transport are two different things but fur simplicity
Expand Down

0 comments on commit a73ec3c

Please sign in to comment.