Skip to content

Commit 9bf8501

Browse files
rename runWorkerFactory -> startWorkerFactory
1 parent c37f492 commit 9bf8501

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

temporal-sdk/src/main/java/io/temporal/common/plugin/WorkerPlugin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* }
5252
*
5353
* @Override
54-
* public void runWorkerFactory(WorkerFactory factory, Runnable next) throws Exception {
54+
* public void startWorkerFactory(WorkerFactory factory, Runnable next) throws Exception {
5555
* registry.recordWorkerStart();
5656
* try {
5757
* next.run();
@@ -139,7 +139,7 @@ default void initializeWorker(@Nonnull String taskQueue, @Nonnull Worker worker)
139139
*
140140
* <pre>{@code
141141
* @Override
142-
* public void runWorkerFactory(WorkerFactory factory, Runnable next) throws Exception {
142+
* public void startWorkerFactory(WorkerFactory factory, Runnable next) throws Exception {
143143
* logger.info("Starting workers...");
144144
* next.run();
145145
* logger.info("Workers started");
@@ -150,7 +150,7 @@ default void initializeWorker(@Nonnull String taskQueue, @Nonnull Worker worker)
150150
* @param next runnable that starts the next in chain (eventually starts actual workers)
151151
* @throws Exception if startup fails
152152
*/
153-
default void runWorkerFactory(@Nonnull WorkerFactory factory, @Nonnull Runnable next)
153+
default void startWorkerFactory(@Nonnull WorkerFactory factory, @Nonnull Runnable next)
154154
throws Exception {
155155
next.run();
156156
}

temporal-sdk/src/main/java/io/temporal/worker/WorkerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public synchronized void start() {
247247
startChain =
248248
() -> {
249249
try {
250-
workerPlugin.runWorkerFactory(this, next);
250+
workerPlugin.startWorkerFactory(this, next);
251251
} catch (RuntimeException e) {
252252
throw e;
253253
} catch (Exception e) {

temporal-sdk/src/test/java/io/temporal/common/plugin/PluginTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public String getName() {
9393
WorkerOptions.Builder workerBuilder = WorkerOptions.newBuilder();
9494
assertSame(workerBuilder, plugin.configureWorker("test-queue", workerBuilder));
9595

96-
// Test runWorkerFactory calls next
96+
// Test startWorkerFactory calls next
9797
final boolean[] called = {false};
98-
plugin.runWorkerFactory(null, () -> called[0] = true);
99-
assertTrue("runWorkerFactory should call next", called[0]);
98+
plugin.startWorkerFactory(null, () -> called[0] = true);
99+
assertTrue("startWorkerFactory should call next", called[0]);
100100

101101
// Test default initializeWorker is a no-op (doesn't throw)
102102
plugin.initializeWorker("test-queue", null);
@@ -150,7 +150,7 @@ public void testExecutionPhaseReverseOrder() throws Exception {
150150
() -> {
151151
order.add(workerPlugin.getName() + "-before");
152152
try {
153-
workerPlugin.runWorkerFactory(null, next);
153+
workerPlugin.startWorkerFactory(null, next);
154154
} catch (Exception e) {
155155
throw new RuntimeException(e);
156156
}
@@ -192,7 +192,7 @@ public WorkflowClientOptions.Builder configureClient(WorkflowClientOptions.Build
192192
private PluginBase createExecutionTrackingPlugin(String name, List<String> order) {
193193
return new PluginBase(name) {
194194
@Override
195-
public void runWorkerFactory(io.temporal.worker.WorkerFactory factory, Runnable next) {
195+
public void startWorkerFactory(io.temporal.worker.WorkerFactory factory, Runnable next) {
196196
next.run();
197197
}
198198
};

0 commit comments

Comments
 (0)