Giter VIP home page Giter VIP logo

Comments (6)

mloughran avatar mloughran commented on July 30, 2024

I completely agree that using keep-alive connections would be great.

Thanks for the pointer to net-http-persistent. I've previously tried some experiments with em-http-request but had a few issues the the handling of dead connections. Hoping to get back on the case with this soon.

I have some refactorings in progress that slightly separate the http connections from the actual api methods (to support multiple api methods), so it's probably worth getting that merged in first or it will be conflict heaven :)

from pusher-http-ruby.

ThisIsMissEm avatar ThisIsMissEm commented on July 30, 2024

Could this actually be better implemented with the Pipe? (when it's out of alpha / beta)

While yes persistent http-connections would be good, if you're sending that many events, then surely there would be even greater benefit from using just one persistent websocket connection?

from pusher-http-ruby.

zimbatm avatar zimbatm commented on July 30, 2024

There is also net-http-pipeline but I don't vouch for the quality of the client. Tell me when you are have done the merge I might take a look at both.

At the moment, we are using right_http_connection but besides the name, it does nothing right. It hijacks Net::HTTP but also randomly throws NoMethodError, TypeError and friends (which happen when the connection is lost). In the end, I wrapped the Pusher::Channel#trigger! with a retryable to make sure the messages are passing trough.

from pusher-http-ruby.

mloughran avatar mloughran commented on July 30, 2024

@zimbatm I've merged the changes I was talking about which refactors the HTTP handling into Pusher::Request. Plenty more improvements that can be made to this, I just teased it apart from the Channel object, but if you do fancy giving pipelining a whirl you're very much welcome :)

from pusher-http-ruby.

mloughran avatar mloughran commented on July 30, 2024

Finally available, using the httpclient gem (not for em-http-request at this stage).

Having looked at all the options, the major advantages and reasons for choosing httpclient were that:

  • Sessions are reused across threads (this is not the case for excon and net-http-persistent for example). This is a big deal in rails apps for example where each incoming http connection spawns a new thread.
  • It has built in support for making async requests using threads with the same sensible session management and reuse. This allows us to support the _async methods even when eventmachine is not available.

from pusher-http-ruby.

jhawthorn avatar jhawthorn commented on July 30, 2024

👎 Ran into issues due to httpclient today (consistent timeout error on every use). Would have much rather used faraday or similar.

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.