diff --git a/insights/core/evaluators.py b/insights/core/evaluators.py index 43b43c4be4..94eee05460 100644 --- a/insights/core/evaluators.py +++ b/insights/core/evaluators.py @@ -53,9 +53,13 @@ def preprocess(self): def run_serial(self, graph=None): dr.run(graph or dr.COMPONENTS[dr.GROUPS.single], broker=self.broker) - def run_incremental(self, graph=None): - for _ in dr.run_incremental(graph or dr.COMPONENTS[dr.GROUPS.single], broker=self.broker): - pass + def run_incremental(self, graph=None, parallel=False): + components = graph or dr.COMPONENTS[dr.GROUPS.single] + if parallel: + with insights.get_pool(parallel, "insights-engine-pool", {"max_workers": None}) as pool: + dr.run_all(components, self.broker, pool) + else: + dr.run_all(components, self.broker) def format_response(self, response): """ @@ -70,10 +74,10 @@ def format_result(self, result): """ return result - def process(self, graph=None): + def process(self, graph=None, parallel=False): with self: if self.incremental: - self.run_incremental(graph) + self.run_incremental(graph, parallel) else: self.run_serial(graph) return self.get_response()