lostisland / faraday-em_synchrony

Faraday adapter for EM::Synchrony
MIT License
2 stars 1 forks source link

uninitialized constant Faraday::Adapter::EMSynchrony::ParallelManager #2

Open Roguelazer opened 1 year ago

Roguelazer commented 1 year ago

I'm trying to use this gem and it seems like I'm missing something?

Gemfile

source "https://rubygems.org"
ruby "~> 3.2"

gem "faraday", "~> 1.0"
gem "faraday-em_synchrony", "~> 1.0"

script.rb

require 'faraday'

conn = Faraday.new do |builder|
  builder.adapter :em_synchrony
end

resps = conn.in_parallel do
  conn.head "https://www.example.com"
end

puts resps

This fails immediately with

./.bundle/ruby/3.2.0/gems/faraday-em_synchrony-1.0.0/lib/faraday/adapter/em_synchrony.rb:37:in `setup_parallel_manager': uninitialized constant Faraday::Adapter::EMSynchrony::ParallelManager (NameError)

        ParallelManager.new
        ^^^^^^^^^^^^^^^
Did you mean?  Faraday::Adapter::EMSynchrony::Parallelism
    from ./.bundle/ruby/3.2.0/gems/faraday-1.10.3/lib/faraday/connection.rb:368:in `default_parallel_manager'
    from ./.bundle/ruby/3.2.0/gems/faraday-1.10.3/lib/faraday/connection.rb:390:in `in_parallel'
    from script.rb:7:in `<main>'

Is there another dependency that I'm missing?

Roguelazer commented 1 year ago

Answer: yes; this gem doesn't depend on em-synchrony, so it needs to be added to the Gemfile, despite what the README says.