rexxars / sse-channel

Server-Sent Events "channel" where all messages are broadcasted to all connected clients, history is maintained automatically and server attempts to keep clients alive by sending "keep-alive" packets automatically.
MIT License
111 stars 11 forks source link

Run SSE broadcast immediately when the request is made #15

Closed GoChartingAdmin closed 7 years ago

GoChartingAdmin commented 7 years ago

Hi,

I am using the express example and is working fine. In the example, the two channels have been placed in a setInterval and so it runs periodically after a a delay of x seconds from the time a request is made. I would like the broadcast to run immediately after the request once and then periodically using the setInterval. Was wondering if you could show me how can I achieve the same

Regards SD

GoChartingAdmin commented 7 years ago

I think I figured it out