Task: provide API to cancel a task
This PR add an API for task cancellation. It contains:
-
Task.cancelled
getter / setter -> allows to knows if the task has been cancelled -
cancel
function: function to be called if the task is cancelled. This is at each task to define the way to handle cancellation. thecancelled
attribute must be set during call tocancel
function. note: This will most likely not be implemented by most tasks. But in the case a user need to be able to cancel a task then this is the entry point.
Edited by payno