Giter Club home page Giter Club logo

Comments (5)

eli-darkly avatar eli-darkly commented on May 31, 2024

There's not much to go on here. For any problem report, it's common to provide some background information such as:

  • what version of this library you are using
  • what Ruby version, on what OS
  • what other dependencies does your application have (for instance, it looks like Faraday is involved here in some way - that is not something ruby-eventsource itself normally uses)
  • does this happen all the time or only under certain circumstances? is it reproducible?

from ruby-eventsource.

ngzax avatar ngzax commented on May 31, 2024

Thanks for you prompt reply. Sorry for the lack of info.

  • ld-eventsource 2.2.0
  • ruby 2.7.4
  • yeah, i am using Faraday (also 2.2.0) for general HTTP ops
  • it is reproducible, i can work to isolate a small bit of code that does it.

I am working with an external app that communicates via SSE and this is my first time using it. It is quite possible that it is this app that is doing something wrong and ld-eventsource is fine, that is why I was hoping for some general advice on debugging SSE application rather than assuming that this is a problem with this lib.

Thanks again for your help.

from ruby-eventsource.

eli-darkly avatar eli-darkly commented on May 31, 2024

Unfortunately I can't think of any general advice in terms of SSE, and I'm not sure how relevant that would be. I mean, it seems pretty clear that this is not an error related to parsing of the event stream, or anything else that is specific to the SSE protocol. The error has something to do with the basic operation of making an HTTP request; it is complaining that it can't open a connection, due to some kind of problem with the low-level OS operations for that. So I think this is less a case of "debugging an SSE application"— more like "debugging a mysterious I/O error in an application that uses HTTP."

I'm puzzled by the presence of a Faraday error here, because ld-eventsource does not use Faraday. As you can see here, it always uses the http gem to create a client. It does have a configuration option socket_factory which lets you customize how sockets are created (this was provided mainly in order to support non-TCP protocols like Unix sockets), so if you are setting that parameter to something that you're getting from Faraday, then that would be the best place to look for problems. But if you're not doing that, I have no idea what's going on. I didn't think Faraday was able to modify how HTTP requests work in code that uses the http gem, but I don't know that library well.

from ruby-eventsource.

ngzax avatar ngzax commented on May 31, 2024

I appreciate you taking the time to write such a nice response.

I think because I am using Faraday to send the PUT which opens the SSE connection, it is overriding your use of the http gem? Not sure.

In any event, at this point it seems like this is clearly an issue on my side and not an issue with the lib, so I will close this out.

Thanks again!

from ruby-eventsource.

eli-darkly avatar eli-darkly commented on May 31, 2024

I think because I am using Faraday to send the PUT which opens the SSE connection, it is overriding your use of the http gem?

I'm not sure how that's even possible, though. I mean, unless I'm missing something in the code (which I wrote, but it's been a while), there isn't any way to pass a pre-made request or connection into SSE::Client; it always creates its own request, using the HTTP::Client instance that it created (see previous link). If you could provide some sample code of how you are involving SSE::Client.new, that might be a clue. Or, if you want to just close this out and leave it at that, I'd still be interested to hear if you eventually find the answer.

from ruby-eventsource.

Related Issues (6)

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.