This pull request is a rework of the cancellation mechanism of lazyflow.
It replaces cancellation calback propagation with CancellationToken mechanism (article about this concept)
What's wrong with callbacks?
Given that lazyflow operators and APIs often used in unexpected places it's possible that anyone at any point can call cancel. With the cancellation token mechanism, only a parent request creator can cancel the request and will be notified about it.
Also it should reduce amount of created callbacks in graph, while we will share reference to parent cancellation token.
TODO
[ ] Test for cancellation when multiple requests waiting on 3rd requests
[ ] Investigate possibility of race conditions during cancellation
This pull request is a rework of the cancellation mechanism of lazyflow. It replaces cancellation calback propagation with
CancellationToken
mechanism (article about this concept)What's wrong with callbacks?
Given that lazyflow operators and APIs often used in unexpected places it's possible that anyone at any point can call cancel. With the cancellation token mechanism, only a parent request creator can cancel the request and will be notified about it. Also it should reduce amount of created callbacks in graph, while we will share reference to parent cancellation token.
TODO