Future cancellation

Sam L'ecuyer sam at cateches.is
Tue Apr 30 12:11:44 PDT 2013


> I don't know what the right shape for a cancellation API is,  but one
> should not assume that this problem is inherent to cancellation. I don't
> think it is. 

Take my input with a grain of salt, but I think it is.

Futures form a cascading pipeline (a series of tubes, if you will) that it promises to follow, either succeeding or failing but always continuing.  Cancellation doesn't fit that model, because it involves either destructively reshaping the pipeline after it's started or trying to shove events in the wrong direction.  If a value is no longer needed and you know ahead of time that it may not be, then a) keep the resolver and reject (reject() takes a value.  Use it.), or b) put an `if` in the success callback.  

-sam






More information about the es-discuss mailing list