Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Chain rescues and failures? #8

Closed
zakdances opened this Issue · 3 comments

2 participants

@zakdances

I've been using the chain: method quite a bit, and I was wondering if you'd thought about the ability to insert rescue and failure blocks into the chain in addition to then blocks?

@b52
Owner

That's an interesting point and I honestly never thought about it until this point. Yet I believe you are right that it might make sense to insert rescue blocks, however I don't see why would want to insert a failure. Because you can always do that on the promise returned by chain:, which fails if any involved promise fails unless you specify a rescue handler.
I'll look into the possibility to allow the insertion of rescue handlers, if you got already something I highly appreciate pull requests. ;)

@b52
Owner
b52 commented

@zakdances I just pushed a branch called chain that contains a new implementation of the chain: combinator. This combinator can in theory cope with all five kinds of block handlers, but I haven't implemented the tests yet to see if that is actually correct due to a lack of time.
If you're willing to you could give it a try.

@b52
Owner
b52 commented

Took me a bit due to exams and work, but I finally finished the new implementation and merged the branch.

@b52 b52 closed this
@b52 b52 added this to the 0.2 milestone
@b52 b52 self-assigned this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.