You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "svetakvsundhar (via GitHub)" <gi...@apache.org> on 2023/07/18 21:31:01 UTC

[GitHub] [beam] svetakvsundhar commented on a diff in pull request #27460: Change DICOM IO API Call to Non-Blocking Async

svetakvsundhar commented on code in PR #27460:
URL: https://github.com/apache/beam/pull/27460#discussion_r1267323757


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/healthcare/DicomIO.java:
##########
@@ -171,20 +172,22 @@ public void instantiateHealthcareClient() throws IOException {
        * @param context The input containing the pub/sub message
        */
       @ProcessElement
+      @SuppressWarnings("FutureReturnValueIgnored")
       public void processElement(ProcessContext context) {
         String dicomWebPath = context.element();
-        try {
-          // TODO [https://github.com/apache/beam/issues/20582] Change to non-blocking async calls
-          String responseData = dicomStore.retrieveDicomStudyMetadata(dicomWebPath);
-          context.output(METADATA, responseData);
-        } catch (IOException e) {
-          String errorMessage = e.getMessage();
-          if (errorMessage != null) {
-            context.output(ERROR_MESSAGE, errorMessage);
+        CompletableFuture.runAsync(() -> {
+          try {
+            String responseData = dicomStore.retrieveDicomStudyMetadata(dicomWebPath);

Review Comment:
   hm alright thanks for the comments. i dont think this is urgent so ill close working on this for now (looks like this maybe a more useful optimization later on).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org