simpleflow
simpleflow copied to clipboard
Use concurrent.futures.Future
Per discussion with @ggreg , we notice that the semantic difference between our version of future (simpleflow.futures.Future) and python's future (concurrent.futures.Future) is mainly:
- behavior when blocking (access to result when computation is running)
- behavior of cancelling
However, these 2 points all come from the SWF executor. As we've separated backend executor (swf, local, local_async), these special future behavior should also be separated from the main interface.
It is proposed to:
- introduce
concurrent.futures.Futureas the baseFuturedefinition. - could also be a sub-class of it to add behavior like
map, see #7 - created a
SwfFuturethat handles Swf specific cancelling and blocking strategy (blocking).