ilastik / lazyflow

lazy parallel ondemand zero copy numpy array data flows with caching and dirty propagation
Other
77 stars 59 forks source link

[WIP] Token based cancellation #330

Open m-novikov opened 5 years ago

m-novikov commented 5 years ago

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