You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Promise.all isn't just implemented by calling then on the passed objects. It is kind of possible to implement Promise.all only using then as the interface for a promise, but then sync couldn't be used on the returned promise. Another behaviour change that would be needed would be that the returned promise wouldn't be rejected as soon as any input promise is rejected.
What is the actual use case? Are you trying to integrate promise.rb with some other library that implements promises? Since there are inconsistencies in just the then method between libraries.
E.g. concurrent-ruby uses the signature def then(rescuer = nil, executor = @executor, &block) compared to promise.rb that uses def then(on_fulfill = nil, on_reject = nil, &block)
Why can't you just use Promise or a class deriving from Promise?
I thought when reading the source that all only used then, but I guess I missed something :)
I'm integrating promise.rb with EventMachine and trying to be as seamless as possible, so it would be nice if all could take an array of mixed promises and deferrables (I've monkeypatched then onto deferrable -- it converts into a promise and then uses Promise#then, so totally compatible)
That way we can use things which do not inherit from Promise but which obey the interface with helpers like
all
The text was updated successfully, but these errors were encountered: