Giter VIP home page Giter VIP logo

Comments (5)

zimbatm avatar zimbatm commented on September 5, 2024

Hi,

I'm not really familiar with celluloid and if it works well with httpclient (the underlying HTTP lib we're using). If it's using multiple threads there might be some concurrency issue in regards to keep-alive. I recommend using 1 pusher instance per thread to see if it fixes the issue. Concurrent access to $outstanding_requests might also be an issue but that shouldn't affect the pusher gem.

The timeout is the default one in the library, see 7dca547 . Any link between your server and ours might fail so adding a retry is definitely a good idea.

from pusher-http-ruby.

zimbatm avatar zimbatm commented on September 5, 2024

It might be easier to create 8 threads and then publish to a Queue object like that: https://gist.github.com/zimbatm/334b4337e61a43e12908

from pusher-http-ruby.

jodosha avatar jodosha commented on September 5, 2024

@zimbatm I'm experiencing thread-safety problems as well. Try to not reuse the same Pusher::Client instance, but create a new one before to use it. https://gist.github.com/zimbatm/334b4337e61a43e12908#file-test-rb-L19

It will be probably slower, but better safe than sorry.

from pusher-http-ruby.

zimbatm avatar zimbatm commented on September 5, 2024

Unless Celluloid is changing ruby radically it should be safe enough to have 1 ruby client per thread. Creating a new instance for each request means not being able to use HTTP keep-alive.

from pusher-http-ruby.

zimbatm avatar zimbatm commented on September 5, 2024

Closing for lack of reproducibility. I believe Celluloid is also now deprecated. For example sidekiq has switched to use the concurrent-ruby gem.

from pusher-http-ruby.

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.