
24 Mar
2007
24 Mar
'07
5:29 p.m.
Braddock Gaskill wrote:
Except for that pesky "cancelation handler" callback, a cancel() call is the same as set_exception(future_cancel()) on the promise. Thus it kind of breaks the promise/future split.
In my proposed model, cancel() doesn't place an exception into the future. It's a consumer-side operation, used to indicate that the consumer is no longer interested in the outcome. set_exception( fork_canceled() ) is called by the producer if the cancel() call succeeds in canceling the task before it has finished.