Cancelling promise operation

127 views
Skip to first unread message

Nicolas FROIDURE

unread,
Jun 8, 2013, 8:19:22 AM6/8/13
to comm...@googlegroups.com
Hi,

I'm currently creating a simple promises implementation based on this specification.

I made a proof of concept based on it to illustrate how promises-based apps could look like : http://codepen.io/seraphzz/pen/oHdJD

But i had to deal with an unexpected problem. Some promises are based on events and when a view is hidden, i need to be able to "cancel" those promise. I suppose the same goes for XHR requests.

So i think it lacks of a way to cancel a promise, is there any work on it currently ?

What i done to deal with its problem is saving a Promise.prototype.dispose method in return of the promise logic function. So, when need, when can cancel promises to avoid memory leak like in the Promise.any method that in fact don't wait for each promises to be released.

Have you any feedback to give on promise cancelling ?

Jason Denizac

unread,
Jun 9, 2013, 7:16:25 PM6/9/13
to comm...@googlegroups.com
Nicolas, active development on the successor to Promises/A is happening at this github organization: https://github.com/promises-aplus

There is a repository there hosting discussion of a proposed cancellation specification.

jason
--
You received this message because you are subscribed to the Google Groups "CommonJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commonjs+u...@googlegroups.com.
To post to this group, send email to comm...@googlegroups.com.
Visit this group at http://groups.google.com/group/commonjs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages