aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-10-08 13:52:48 +0200
committerJon Bratseth <bratseth@gmail.com>2021-10-08 13:52:48 +0200
commit475f0c93523daa1c3c53786ee8a9a9aee6702204 (patch)
treed20932871aa4c917052f2e37dde77c5d4a880e39 /container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
parent9d435e48c742b3efc94c68c02da835c5f5298255 (diff)
Use the executor from the context
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/searchchain/Execution.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/searchchain/Execution.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java b/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
index 86ba8664dee..fc2d44e01d9 100644
--- a/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
+++ b/container-search/src/main/java/com/yahoo/search/searchchain/Execution.java
@@ -18,6 +18,7 @@ import com.yahoo.search.rendering.RendererRegistry;
import com.yahoo.search.statistics.TimeTracker;
import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
/**
* <p>An execution of a search chain. This keeps track of the call state for an execution (in the calling thread)
@@ -122,7 +123,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
this.tokenRegistry = tokenRegistry;
this.rendererRegistry = rendererRegistry;
this.linguistics = linguistics;
- this.executor = executor != null ? executor : Runnable::run; // Run in same thread if no executor is provided
+ this.executor = executor != null ? executor : Executors.newSingleThreadExecutor();
}
/** @deprecated pass an executor */
@@ -362,7 +363,7 @@ public class Execution extends com.yahoo.processing.execution.Execution {
/**
* Returns the executor that should be used to execute tasks as part of this execution.
- * This is never null but will be an executor that runs in the same thread if none is passed to this.
+ * This is never null but will be an executor that runs a single thread if none is passed to this.
*/
public Executor executor() { return executor; }