eriknw / afar

Run code on a Dask cluster via a context manager or IPython magic
Other
30 stars 0 forks source link

Add `.cancel` method to cancel pending tasks. #17

Closed eriknw closed 3 years ago

eriknw commented 3 years ago

Also, cancel on KeyboardInterrupt. Fixes #15

@gjoseph92 and @jrbourbeau this is my best-effort attempt at this. It would be preferable to add tests to exercise this, but afar's testing with distributed is pretty limited. We may need to borrow some scaffolding from distributed to make this easier. In the mean time, users are the main source of testing :)

I use weakrefs for the futures and the client so that they can be cleaned up ASAP.

eriknw commented 3 years ago

YOLO. Merging.

jrbourbeau commented 3 years ago

You're quick! I'll give some of the recent change a try next week 👍