wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

connect/disconnect callbacks #44

Closed wandenberg closed 9 years ago

wandenberg commented 12 years ago

Add a way to know when a subscriber connects and when it disconnects

pgrishin commented 11 years ago

Which way you want to send callbacks?

wandenberg commented 11 years ago

The first idea is to have some directives where you can configure a url to be called when the user connect/disconnect. With this, each application can decide what to do with the information. If you have any other suggestion, tell me about it.

pgrishin commented 11 years ago

I have same ideas, but i think http is expensive. If another http server hangs, it is posible when queue will use all buffers and lose some callbacks. I think may be better way to send callbacks via something like udp, including incremental callback id for fully channels list reload if needed. Or also it is possible to use something like gearmand, for sending callbacks to job server, whose main role is something like this async callback. I think second way is not bad, because job servers have many libs, i.e. java, php, c and so on. Also it looks like easy to implement this feature.

lisachenko commented 11 years ago

We can also use special internal WebSocket/etc location to receive notifications. It will be easy to implement and will use the same source code internally! Application will subscribe on this special channel and will receive notifications about subscribers in the realtime.

wandenberg commented 11 years ago

Probably this will be the implementation, because I have another feature request to has these information also on client side. Now I'm trying to improve the shared memory usage, and than I will return to these features.

wandenberg commented 9 years ago

Finally implemented at 2e6632033d75e8030f1402ee77269b451ba48248 Just configure push_stream_events_channel_id and push_stream_allow_connections_to_events_channel

lisachenko commented 9 years ago

:+1: