summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-08-03 11:11:58 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-08-03 11:33:44 +0200
commita424aa5e81c31f8cc6ba8846f0a6af29623588d4 (patch)
tree18006e7c5b3c9c2ff4faa9a988a29a8a6c0499c3 /opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc
parentf6932d264db5b2e185ec7ea7aaec84dfb83f8fe9 (diff)
refactor(web/runner): Support pluggable job manager
This change introduces a new interface `JobManager` that is responsible for communicating with the backend about the available jobs and updating their status when the runner is simulating a job. This manager can be injected into the `OpenDCRunner` class and allows users to provide different sources for the jobs, not only the current REST API.
Diffstat (limited to 'opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc')
-rw-r--r--opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java
index c1f356bc..eccc8dcf 100644
--- a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java
+++ b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java
@@ -27,6 +27,7 @@ import io.quarkus.runtime.ShutdownContext;
import io.quarkus.runtime.annotations.Recorder;
import org.jboss.logging.Logger;
import org.opendc.web.client.runner.OpenDCRunnerClient;
+import org.opendc.web.runner.JobManager;
import org.opendc.web.runner.OpenDCRunner;
import java.io.File;
@@ -54,7 +55,7 @@ public class OpenDCRunnerRecorder {
OpenDCRunnerClient client = new OpenDCRunnerClient(apiUrl, null);
OpenDCRunner runner = new OpenDCRunner(
- client,
+ JobManager.create(client),
new File(config.tracePath),
parallelism,
config.jobTimeout,
@@ -77,7 +78,7 @@ public class OpenDCRunnerRecorder {
Thread thread = new Thread(() -> {
try {
// Wait for some time to allow Vert.x to bind to the local port
- Thread.sleep(1000);
+ Thread.sleep(4000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}