You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this moment our PipeTo support scenarios of failed or succeed task execution. However it turned out, that it may not work when a Task is being cancelled - the code in theory should work, however in practice it may not be the case.
We need tests in PipeToSupportSpec which will confirm that task cancellation is handled correctly.
Also another matter - something to discuss about - is what the correct behavior should be in case if this case is not handled at this moment.
As @OnurGumus in case of cancellation task.Exception can be null. I this is the only case (I haven't heard about the case when task.IsFailed is true and no exception has been provided), we could propagate null exception and i.e. add IsCancelled property to Status.Failure.
We could explicitly convert null exceptions to OperationCancelledException and forward it to failure case of PipeTo method. Afaik this is the closest to actual JVM Akka behavior - Akka Futures don't have cancellations, but if future times out a Status.Failure with TimeOutException is returned.
We can also add third case (like Status.Cancelled), however I'm afraid that this will increase complexity of the overall solution.
The text was updated successfully, but these errors were encountered:
At this moment our
PipeTo
support scenarios of failed or succeed task execution. However it turned out, that it may not work when a Task is being cancelled - the code in theory should work, however in practice it may not be the case.We need tests in PipeToSupportSpec which will confirm that task cancellation is handled correctly.
Also another matter - something to discuss about - is what the correct behavior should be in case if this case is not handled at this moment.
task.Exception
can be null. I this is the only case (I haven't heard about the case whentask.IsFailed
is true and no exception has been provided), we could propagate null exception and i.e. addIsCancelled
property toStatus.Failure
.OperationCancelledException
and forward it to failure case ofPipeTo
method. Afaik this is the closest to actual JVM Akka behavior - Akka Futures don't have cancellations, but if future times out aStatus.Failure
withTimeOutException
is returned.Status.Cancelled
), however I'm afraid that this will increase complexity of the overall solution.The text was updated successfully, but these errors were encountered: