From 8046688b6df0e24e6a6f6201ee4862dca19b96ed Mon Sep 17 00:00:00 2001 From: Mladjan Gadzic Date: Tue, 24 Dec 2024 16:39:08 +0100 Subject: [PATCH] make armada client autocloseable (#10) --- pom.xml | 2 +- src/main/java/io/armadaproject/ArmadaClient.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c55ad6f..adc1856 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.armadaproject java-client - 0.0.1 + 0.0.2 jar Java client library for the Armada project java-client diff --git a/src/main/java/io/armadaproject/ArmadaClient.java b/src/main/java/io/armadaproject/ArmadaClient.java index 6f4c0fa..09f64ee 100644 --- a/src/main/java/io/armadaproject/ArmadaClient.java +++ b/src/main/java/io/armadaproject/ArmadaClient.java @@ -24,7 +24,7 @@ import io.grpc.stub.MetadataUtils; import java.util.Iterator; -public class ArmadaClient { +public class ArmadaClient implements AutoCloseable { private final ManagedChannel channel; @@ -84,4 +84,9 @@ public JobStatusResponse getJobStatus(JobStatusRequest jobStatusRequest) { return jobsBlockingStub.getJobStatus(jobStatusRequest); } + @Override + public void close() throws Exception { + channel.shutdown(); + } + }