Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make notify return a promise derived from onProgress return values/throws. #340

Closed
domenic opened this issue Jul 4, 2013 · 3 comments
Closed

Comments

@domenic
Copy link
Collaborator

domenic commented Jul 4, 2013

See promises-aplus/progress-spec#3 (comment). 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)).

@kriskowal
Copy link
Owner

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.

@TimDaub
Copy link

TimDaub commented Jul 24, 2015

NOOOOOOOOOOOOOOOOOOOOOOOOOO

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?

@kriskowal
Copy link
Owner

@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/kriskowal/gtor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants