Closed hanazuki closed 1 year ago
This should fix it
diff --git a/lib/concurrent-ruby/concurrent/promises.rb b/lib/concurrent-ruby/concurrent/promises.rb
index 76af4d59..eb0c5e2e 100644
--- a/lib/concurrent-ruby/concurrent/promises.rb
+++ b/lib/concurrent-ruby/concurrent/promises.rb
@@ -2074,8 +2074,8 @@ module Concurrent
private
- def resolvable?(countdown, future, index)
- future.fulfilled? ||
+ def resolvable?(countdown, event_or_future, index)
+ (event_or_future.is_a?(Event) ? event_or_future.resolved? : event_or_future.fulfilled?) ||
# inlined super from BlockedPromise
countdown.zero?
end
@hanazuki Could you make a PR with @pitr-ch's patch and add a spec?
Done @eregon
Documentation on
Promises.any_fulfilled_future_on
says:But actually it fails when you pass an Event to the function.
Reproducing code:
Output: