Closed jhalterman closed 2 years ago
It would be nice to be able to register a cancellation handler, in order to help propagate cancellations through async executions:
failsafe.getAsyncExecution(exec -> { Future future = workInSomeOtherThread().whenDone(result -> { exec.recordResult(result); }; exec.onCancel(shouldInterrupt -> future.cancel(shouldInterrupt)); });
A shortcut for this would be to recognize separately created futures, so that cancellations can be propagated to them:
failsafe.getFutureAsyncExecution(exec -> { Future future = workInSomeOtherThread().whenDone(result -> { exec.recordResult(result); }; return future; });
getStageAsyncExecution should maybe be deprecated in favor of getFutureAsyncExecution since the former already has a completion handler that Failsafe uses to record results, so the explicit AsyncExecution.record is not needed.
3.0 has been released, which includes this improvement.
It would be nice to be able to register a cancellation handler, in order to help propagate cancellations through async executions:
A shortcut for this would be to recognize separately created futures, so that cancellations can be propagated to them:
getStageAsyncExecution should maybe be deprecated in favor of getFutureAsyncExecution since the former already has a completion handler that Failsafe uses to record results, so the explicit AsyncExecution.record is not needed.