Closed domenic closed 10 years ago
This change could not land until v2. As it happens, notify and progress have been removed outright in v2, and if they are reintroduced, will not compose. Closing.
I'm trying to abort the hashing of a number of files and I'm using Q's promises to handle the async part. So since this is never going to work in 1.0, I guess its not possible to stop the execution of a promise from the outside or is it?
@tomdaub cancellation is an unrelated concern to progress/notify. Q promises have multiple consumer semantics, so cancellation is tricky. I am contemplating building a library with a "task" primitive that is similar to a promise but with explicit fork() and cancel(), and @domenic is actively working out whether promises can become cancelable promises with reference counting on observers.
See https://github.com/promises-aplus/progress-spec/issues/3#issuecomment-11609297. This would replace our current strategy of crashing if
onProgress
throws.I believe it would be something along the lines of
Q.all(progressHandlers.map(Q.fcall))
.