Git Product home page Git Product logo

Comments (3)

route avatar route commented on May 22, 2024 1

JRuby support is not guaranteed because concurrent-ruby gem has now troubles on JRuby, if you are looking for a threaded solution you might be interested in https://github.com/rubycdp/vessel

from ferrum.

rajuvvadi avatar rajuvvadi commented on May 22, 2024

Hey @route @oshanz , I have a Sidekiq Job that opens a website and navigates through 5 pages while filling input fields and checking radio/checkboxes.

I haven't gone through entire Ferrum code, so my patch might be incorrect or doesn't make sense. But, Here's what I did to possibly fix Concurrent::MultipleAssignmentError issue in my app.

  # file: lib/ferrum/browser/client.rb
  def initialize
    # .....
    # 
    while message = @ws.messages.pop
      if INTERRUPTIONS.include?(message["method"])
        @interruptor.async.call(message)
      elsif message.key?("method")
        @subscriber.async.call(message)
      else
        # here's the change
        retries_left = 3
        begin
          @pendings[message["id"]]&.set(message)
        rescue Concurrent::MultipleAssignmentError => e
          retries_left -= 1
          if retries_left > 0
            # retry after sleeping 200ms
            sleep(0.2)
            retry
          end
          raise e
        end
      end
    end
    # .....
  end

After this patch, I am yet to see any issues in my script. Plus, app doesn't throw that exception and terminate anymore.

from ferrum.

route avatar route commented on May 22, 2024

@rajuvvadi I'm afraid it's only a hack, which doesn't solve the real issue

from ferrum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.