0

I am struggling to figure out why the task is not cancelling when using CompletableFuture#cancel. Essentially, I am creating an asynchronous task, which does it's thing (time consuming), after it finishes a single "part" it checks the original future to see if it was ComplateableFuture#isCancelled.

Here's the commit (ignore some useless code) - the invocation is in the test. The archive handler checks the cancelled state. https://github.com/Axieum/Compressum/commit/ccc1edcbac8df684e10339f4106a7b1817af9397

Axiom
  • 37
  • 6
  • 1
    Possible duplicate of [How to interrupt underlying execution of CompletableFuture](https://stackoverflow.com/questions/29013831/how-to-interrupt-underlying-execution-of-completablefuture) – Slaw Nov 11 '18 at 14:46
  • Do you ever call your `Compressum.cancel()` method? – yegodm Nov 11 '18 at 14:52
  • No, that was just there as a test. Will probably resort to that. Just wanted to see if could get it working with futures built-in cancelling. – Axiom Nov 11 '18 at 23:38

0 Answers0