As per https://github.com/google/java-photoslibrary/issues/30#issuecomment-904352898, I can confirm that interrupting the upload via interrupting the thread blocked on
client.uploadMediaItemCallable().futureCall(uploadRequest).get()
works.
However, as before, both
client.uploadMediaItem()
and
client.uploadMediaItemCallable().call(uploadRequest)
block uninterruptibly,
because ApiExceptions.callAndTranslateApiException calls Futures.getUnchecked(future), which blocks uninterruptibly by design.
I don't know in which situation one would ever want to block uninterruptibly to be honest. It's a road to unresponsive apps, leaking threads etc. Also, the behaviour should be symmetrical regardless of how you invoke the API. At the very least, the interrupt behaviour must be documented.
As per https://github.com/google/java-photoslibrary/issues/30#issuecomment-904352898, I can confirm that interrupting the upload via interrupting the thread blocked on
client.uploadMediaItemCallable().futureCall(uploadRequest).get()
works. However, as before, bothclient.uploadMediaItem()
andclient.uploadMediaItemCallable().call(uploadRequest)
block uninterruptibly, becauseApiExceptions.callAndTranslateApiException
callsFutures.getUnchecked(future)
, which blocks uninterruptibly by design.I don't know in which situation one would ever want to block uninterruptibly to be honest. It's a road to unresponsive apps, leaking threads etc. Also, the behaviour should be symmetrical regardless of how you invoke the API. At the very least, the interrupt behaviour must be documented.