Skip to content

Commit 6094775

Browse files
committed
Introduce closeNow() for
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
1 parent 02fa2c8 commit 6094775

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sdk-workflows/src/main/java/io/dapr/workflows/runtime/WorkflowRuntime.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.dapr.durabletask.DurableTaskGrpcWorker;
1717
import io.grpc.ManagedChannel;
1818

19+
import java.time.Duration;
1920
import java.util.concurrent.ExecutorService;
2021
import java.util.concurrent.TimeUnit;
2122

@@ -72,6 +73,14 @@ public void close() {
7273
this.closeSideCarChannel();
7374
}
7475

76+
/**
77+
* Immediately shuts down all resources associated with this instance.
78+
*/
79+
public void closeNow() {
80+
this.executorService.shutdownNow();
81+
this.managedChannel.shutdownNow();
82+
}
83+
7584
private void closeSideCarChannel() {
7685
this.managedChannel.shutdown();
7786

0 commit comments

Comments
 (0)