kmgreen2 / agglo

Agglo: A Process-Anywhere Framework for Event Stream Processing
https://kmgreen2.github.io/agglo/
MIT License
2 stars 0 forks source link

Failed Futures Should Cancel Child Futures #2

Open kmgreen2 opened 3 years ago

kmgreen2 commented 3 years ago

Basically need to cancel all futures that occur after a failed future, provided the future is required.

The current behavior is to fail all futures after a failed future. This is confusing, because all child futures have the same failure message as the originally failed future.

Here are examples based on the following chain: CreateFuture(r1).Then(r2).Then(r3).Then(r4) == f1, f2, f3, f4

  1. f1 succeeds and f2 fails: f1 == success, f2 == failed, f3 ==canceled, f4 == canceled
  2. f1 succeeds, f2 fails and f2 is fail-able, f3 fails: f1 == success, f2 == failed, f3 == failed, f4 == canceled
kmgreen2 commented 3 years ago

Going to put this on hold... The behavior is a bit weird, since we cannot tell the difference between a failure and an explicit cancel operation.

One way around this is to supply a cause to Cancel, but that also could be weird.