Live data from Hacker News

Show HN: Nchan – a pub/sub server as an Nginx module

nchan.slact.net

41–44 of 44 posts

Re: Show HN: Nchan – a pub/sub server as an Nginx module

#41
post #38
post #36

Earlier quoted context omitted.

nice! I initially stayed away from lua due so I could support earlier redises, but these days I would totally take that dependency on to simplify the code. regarding that implementation, one diff I am spotting is that I also have a concept of global message id / global channel, this allows us to subscribe to a single spot and distribute from there (which keeps thread counts down and is particularly useful for server…

> global message id / global channel Yeah, I don't have global ids. every message is bound to the channel it was published to. But I do understand that for your use case, (user + arbitrary list of groups), you'd need a good deal more than 4 channel multiplexing. It's a pretty strong use case and I'll see what I can do in the next month. Of course, I can be incentivized to work faster with a generous donation :) > Reg…

>All the cool kids were talking about it, so I thought I might as well support them, too.

I agree with Sam Saffron (thanks Sam for al your githubcode) about some perplexity using websockets as a panacea nowadays.

Nevertheless, I really appreciated Nchan structured approach, open to different available protocols (poll, SSE, websockets) :)

Re: Show HN: Nchan – a pub/sub server as an Nginx module

#42
post #30
post #15

Earlier quoted context omitted.

I'm not familiar with MQTT, I've just glanced over the spec right now. Nchan is basically a message broker with channels, optimized for message broadcast. MQTT is a TCP-level protocol, whereas all the currently implemented subscriber clients for Nchan are HTTP-level (Longpoll, EventSource and Websocket, which begins with an HTTP request). MQTT subscribers and publishers could be implemented in nchan, but I haven't ye…

I see. Thank you for this, I'll give it a shot and see how a simple client compares to an MQTT client. If I get a good performance on a C/C++ client then this could be a viable option for push notification in the IoT domain.

>this could be a viable option for push notification in the IoT domain.

Yes! :)

Re: Show HN: Nchan – a pub/sub server as an Nginx module

#43
post #39
post #32

Earlier quoted context omitted.

Well, if it ain't broke, as they say... here's a page on the differences between Nchan and the Push Module: https://nchan.slact.net/upgrade . One important thing I forgot to add is that the Push Module suffered from memory fragmentation under high load, and with a fixed-size shared-memory chunk that could mean running out of usable shared memory for a long-running nginx process. If you're not experiencing that, and y…

Thanks for the upgrade link. I missed that. Great that NCHAN is (almost; besides directive prefix) configuration compatible! The "Subscribers" section of "Push Module" should include websocket, I think.

> besides directive prefix

The old setting is still recognized.

> Subscribers" section of "Push Module" should include websocket

Nope, push module didn't do websocket. You may be thinking of the Push _Stream_ module, which is an independent push module fork.

Re: Show HN: Nchan – a pub/sub server as an Nginx module

#44
post #2

This is a huge refactoring of an old project of mine -- the Nginx HTTP Push Module. I'm wondering if anyone here has used it. Most importantly, I want feedback on the documentation. Did I overcomplicate things? Does it need more examples? Does it need more live code? Is it too long? Too short? Etc.

great project! I retwitted: https://twitter.com/solyarisoftware/status/67379850204928000... Documentation is VERY well done. publisher: Curl examples are perfect. subscribers: maybe some examples in a language ( Ruby? :-) ) could help dummies like me. I'll study and if I can I'll propose you respect giorgio

Thanks! I'll be adding a sample JS subscriber client and some sample code with that as well.
Post reply on HN