-
Notifications
You must be signed in to change notification settings - Fork 416
Closed
Labels
looking-for-contributorWe are looking for a contributor to help with this issue.We are looking for a contributor to help with this issue.
Description
Documentation on Promises.any_fulfilled_future_on says:
If event is supplied, which does not have value and can be only resolved, it's represented as :fulfilled with value nil.
But actually it fails when you pass an Event to the function.
Reproducing code:
require 'concurrent'
p Concurrent::VERSION
p Concurrent::Promises.any_fulfilled_future(Concurrent::Promises.resolved_event).value! # => Expect nilOutput:
"1.1.10"
~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:2078:in `resolvable?': undefined method `fulfilled?' for #<Concurrent::Promises::Event:0x00007f672f3cfa30 resolved> (NoMethodError)
future.fulfilled? ||
^^^^^^^^^^^
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:1658:in `on_blocker_resolution'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:808:in `callback_notify_blocked'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:786:in `call_callback'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:751:in `add_callback'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:732:in `add_callback_notify_blocked'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:1637:in `block in new_blocked_by'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:1637:in `each'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:1637:in `each_with_index'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:1637:in `new_blocked_by'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:312:in `any_fulfilled_future_on'
from ~/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promises.rb:299:in `any_fulfilled_future'
from any_fulfilled_future.rb:4:in `<main>'
* Operating system: linux
* Ruby implementation: Ruby
* `concurrent-ruby` version: 1.1.10
* `concurrent-ruby-ext` installed: no
* `concurrent-ruby-edge` used: no
Metadata
Metadata
Assignees
Labels
looking-for-contributorWe are looking for a contributor to help with this issue.We are looking for a contributor to help with this issue.