Git Product home page Git Product logo

eventsource's People

Contributors

antage avatar dominikh avatar flyingmutant avatar karl-gustav avatar makew0rld avatar mvrilo avatar oz avatar polyfloyd avatar stuartnelson3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eventsource's Issues

What is the best way to separate consumers?

Hi,

If I got multiple consumers with "private" channels*, should I create a new EventSource instance for each one or is there an internal way to handle this?

  • I.e. that I want to send separate messages to each consumer.

How to detect client disconnection ?

Hello,
I'm developping chat rooms based on Twitter hashtag with Server sent events.
I have a problem concerning the disconnection of the client. I run a goroutine to send messages to the client, but when the client disconnects, the goroutine still runs.
I don't know how to detect on the server side that the client is disconnected.
You can find a part of my code here : https://gist.github.com/Guiguillermo/f214fbda9aacec1ea5d9

Thanks !

How do I handle disconnecting consumers manually?

I'm not seeing a good mechanism here to disconnect a consumer manually.

My use-case is this: a client will make a POST /some-route which kicks off a back-end service and allows other clients to watch for SSE on GET /events and I'm simply forwarding all output from the back-end service to the clients via es.SendMessage. I would like to close the SSE connections on those clients when the back-end service is finished.

Do you have any ideas?
Thanks!

Custom HTTP headers

eventsource should have ability to specify additional http headers in SSE response.

Buffering delays?

Have you ever experienced an issue when the 200 OK + Content-Type is buffered up on non-local connections and are sent when there's enough data in the pipe or when some timeout is reached? I see this behaviour when I connect to my local dev server through ngrok.com proxy, and, what is much worse, it looks like such responses are immediately halted by Amazon ELBs (or at least this is how I currently interpret the fact that these requests are immediatelly marked as "cancelled" by Chrome)

How to use handlerFunc?

I am quite confused on how to use handleFunc instead of http.handle with es instance.
Any example would be helpful. Thanks

Consider sending the X-Accel-Buffering header

X-Accel-Buffering is a header understood by nginx when proxying requests, to disable buffering.

I know that it's just one of many such custom headers, but it'd be nice to have at least the most important one supported.

Alternatively, a way to insert custom headers might be useful.

What is the license for your code?

I did some quick benchmarks, it appears that each connection uses between 15-20K of memory. Thats not bad. Considering that each net.Listen() connection takes up 10K of memory and you implemented the SSE logic.

Can you add a license file to your code?

Max number of connections

I am evaluating servers to use along with EventSource clients.

How many concurrent connected clients were you able to have on one cyclone instance?
(With a Node.js server I was able to handle up to >5000 concurrent event source streams)

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.