From 60947758528b74598f2461f8fd326c2bfa9d0144 Mon Sep 17 00:00:00 2001 From: Matheus Cruz Date: Wed, 28 Jan 2026 23:48:02 -0300 Subject: [PATCH] Introduce closeNow() for Signed-off-by: Matheus Cruz --- .../java/io/dapr/workflows/runtime/WorkflowRuntime.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntime.java b/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntime.java index 09f831a563..9697d41b2a 100644 --- a/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntime.java +++ b/sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntime.java @@ -16,6 +16,7 @@ import io.dapr.durabletask.DurableTaskGrpcWorker; import io.grpc.ManagedChannel; +import java.time.Duration; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; @@ -72,6 +73,14 @@ public void close() { this.closeSideCarChannel(); } + /** + * Immediately shuts down all resources associated with this instance. + */ + public void closeNow() { + this.executorService.shutdownNow(); + this.managedChannel.shutdownNow(); + } + private void closeSideCarChannel() { this.managedChannel.shutdown();