Nginx push question

Hi.

I found the nginx_push_module recently and I’m trying to find if it can
fill my needs.
It is really fantastic when 1 user subscribe to 1 stream.

But, can someone tell me if there is a way for one user to subscribe
with one request to many channel ?
I don’t think because in the activity http response, there is no header
with he channel id to distinguish responses :

GET /activity?id=2 HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7
OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
Host: 127.0.0.1:8080
Accept: /

HTTP/1.1 200 OK
Server: nginx/0.7.67
Date: Wed, 30 Jun 2010 08:34:50 GMT
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
Last-Modified: Wed, 30 Jun 2010 08:34:01 GMT
Connection: keep-alive
Etag: 0
Vary: If-None-Match, If-Modified-Since

test

I suppose that a header like
Channel-id: 2
wouldn’t be hard to add but would it be hard to allow to subscribe with
a request like
GET /activity?id=1&id=3&id=36…
?

I’m trying to use nginx on a mobile application where users can
subscribe to many, many streams.
But I don’t wan’t, if I can, to make a channel per user and I don’t
wan’t each user to have as many request pending as subscribed channels

A channel per user would be possible but

  • I must keep on server side which user subscribed to which channel
  • I must handle case where users does not exist anymore to stop wasting
    time trying to send them data …

Any idea of how I can accomplish this actually ?
Maybe I missed something ?

Thanks anyway for this module !

Mike Baroukh


Cardiweb - 29 Cite d’Antin Paris IXeme
+33 6 63 57 27 22 / +33 1 53 21 82 63
http://www.cardiweb.com/

On 30/06/2010 09:55, Mike Baroukh wrote:

header with he channel id to distinguish responses :

Hi Mike,

The way to do this is to have two httprequests outstanding, one for each
channel.

If you set them up with different callbacks for when a response arrives
then the messages for each channel will flow through independently of
the other.

Regards

Ian

Hi Ian.

Thanks a lot for your response.

I knew I can do this way but as said in my question :

I don’t wan’t each user to have as many request pending as subscribed
channels …

:slight_smile:

I suppose it is effectively actually the only way but I think it would
not be hard to have something less resources consuming.
I’ll try to look at the module but I’m not a c programmer (I only have
Java skills).

Thanks.

Mike Baroukh


Cardiweb - 29 Cite d’Antin Paris IXeme
+33 6 63 57 27 22 / +33 1 53 21 82 63
http://www.cardiweb.com/

Le 30/06/2010 11:47, Ian H. a écrit :