Task or process is another kind of object. I prefer not to integrate task/process into function object, either.
It is better to have another object/plugin to manipulate task/process, to start or cancel it.
One possible solution is using my FSM plugin
( or FSM behavior
1. Create task -- create a FSM instance
2. Initial task -- set callback function by function name in private variable of this FSM instance
3. Run task -- change state with input and private variables
4. Stop task -- change state to END, run callback
5. Delete task -- destroy this FSM instance
Edit: Here is another way to pass function call by using this plugin
, which serialize function call into a string.