Jump to content

The ultimate community for Ruby on Rails developers.


PurePromise - Promises/A+ with a twist

  • Please log in to reply
No replies to this topic

#1 cameron-martin



  • Members
  • 1 posts

Posted 17 August 2014 - 11:35 PM


I've recently written a promises library in ruby. It implements the Promises/A+ spec almost exactly, with one difference - A promise callback must return a promise.

This gives them some nice properties, particularly thenables can be wrapped in promises. With the current Promises/A+ spec, trying to use an object that happens to implement a then method as a value for a promise will essentially break a promise chain, causing potentially hard to debug problems.

It draws partially from Promise.rb (https://github.com/lgierth/promise.rb), being agnostic about which reactor library you use.

Here is the github link: https://github.com/c...in/pure_promise.

I'd love feedback :)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users