Skip to content

Commit f348853

Browse files
authored
Conductor support (#30)
1 parent 9dd186c commit f348853

32 files changed

Lines changed: 2103 additions & 0 deletions

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ dependencies {
5454
testImplementation("io.rest-assured:xml-path:5.4.0")
5555
testImplementation(platform("org.junit:junit-bom:5.10.0"))
5656
testImplementation("org.junit.jupiter:junit-jupiter")
57+
testImplementation("org.java-websocket:Java-WebSocket:1.5.6")
5758
}
5859

5960
tasks.test {

src/main/java/dev/dbos/transact/DBOS.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.dbos.transact;
22

3+
import dev.dbos.transact.conductor.Conductor;
34
import dev.dbos.transact.config.DBOSConfig;
45
import dev.dbos.transact.database.SystemDatabase;
56
import dev.dbos.transact.execution.DBOSExecutor;
@@ -38,6 +39,7 @@ public class DBOS {
3839
private final QueueService queueService;
3940
private final SchedulerService schedulerService;
4041
private NotificationService notificationService;
42+
private Conductor conductor;
4143
private HttpServer httpServer;
4244
private RecoveryService recoveryService;
4345

@@ -222,6 +224,12 @@ public void launch() {
222224
notificationService.start();
223225
}
224226

227+
String conductorKey = config.getConductorKey();
228+
if (conductorKey != null) {
229+
conductor = new Conductor.Builder(systemDatabase, dbosExecutor, conductorKey).build();
230+
conductor.start();
231+
}
232+
225233
if (config.isHttp()) {
226234
httpServer = HttpServer.getInstance(config.getHttpPort(),
227235
new AdminController(systemDatabase, dbosExecutor));
@@ -263,6 +271,10 @@ public void shutdown() {
263271
notificationService.stop();
264272
}
265273

274+
if (conductor != null) {
275+
conductor.stop();
276+
}
277+
266278
if (config.isHttp()) {
267279
httpServer.stop();
268280
}

0 commit comments

Comments
 (0)