6 ms·
Interacting with ZeroMQ from the browser
- dripton 15y agoNeat. I've wanted ZeroMQ in my browser. I checked the README file for a license, but instead it says "ZeroMQ in your brower, yo!" Which tells me that: 1. I can't use it. 2. The author is 12. 3. It probably doesn't work.
- avalanche123 15y agoHi, the author is not twelve and he in fact is quite known in Python community. I'll ping him about missing license.
- dochtman 15y agoTo wit, useful READMEs are useful. Make use of that fact, please.
- avalanche123 15y agoYup, I'm sure that will get updated
- tripzilch 15y ago(upvoted for funny, even though incorrect)
- loeg 15y agoTry the LICENSE file or header comments in the sources.
- dripton 15y agoObviously, the LICENSE file wasn't there when I posted my snarky comment. Props to the author for adding one, though, since now I know that I can use this code.
- tjholowaychuk 15y agoand it's written with noobish coffeescript and cakefiles :s
- avalanche123 15y agoHaha, I know you don't like coffeescript, so I wrote clone client library for demo in pure JS - https://github.com/progrium/nullmq/blob/master/demos/presence/html/js/presence-0.1.0.js https://github.com/progrium/nullmq/blob/master/demos/presenc...
- tjholowaychuk 15y agoit just looks like js generated with coffeescript.. not really the same thing
- avalanche123 15y agoheh, best I can do yet
- oscilloscope 15y agoit looks like idiomatic javascript to me
- progrium 15y agoI updated it to be slightly more useful.
- rumcajz 15y ago"ZeroMQ’s actual C library (libzmq) is just an implementation detail." That's a spot on. It doesn't really matter whether you are using ZeroMQ, NullMQ or raw HTTP. It's like OO-programming: You can write OO program in any language. Same way, you can do distributed messaging on top of any transport layer.
- avalanche123 15y agoExactly, I'm very happy that message went through!
- malkia 15y agoNot that it matters much, but ZeroMQ is written in C++, while exposing "C" only interface, and then additionally there is a C++ binding to this "C" interface, which IMHO is very robust design (C for API is much easier to access from other langs).
- avalanche123 15y agoYou are right, however C bindings in other languages usually look quite ugly and non-idiomatic, but ZeroMQ did great job in that sense and their higher level language bindings are written with language specifics in mind
- dochtman 15y agoI like delivering ZeroMQ content to the browser (I have even written my own little WebSockets server to deliver ZeroMQ-pubsub meessages to my webapp), but I'm not sure I understand what the use for STOMP or NullMQ is, here. Is STOMP just used for to translate some bits to ZeroMQ frame terms and NullMQ used as the WebSockets-to-ZeroMQ broker? Why is this better than https://github.com/tailhook/zerogw https://github.com/tailhook/zerogw?
- avalanche123 15y agoNullMQ multiplexing protocol is built on top of STOMP. The main advantage of NullMQ is same socket primitives as ZeroMQ, so same patterns and solutions can be built in the browser.
- msutherl 15y agoI'm new to ZeroMQ. Would you be willing to provide a quick example scenario where this might be useful?
- avalanche123 15y agoI feel the example I built for our demo is a good one. Here I implemented presence and chat servers to build online chatroom. Servers and clients were initially built in Ruby, to be used in a private network behind firewall. I was then able to re-use client code with minimal changes and port it into JavaScript. This client code gave presence and chat to the browser. So effectively we solved an interesting networking problem once and were able to re-use the solution in two vastly different environments - private networks and the browser, where different authentication, authorization, performance and guarantees requirements apply.
- alberth 15y agoMongrel2.org anyone?
- progrium 15y agoMongrel2 uses ZeroMQ to handle HTTP. Not really the same thing at all.
- Alexandervn 15y agoMongrel2 is a webserver and does ZeroMQ serverside. This is about ZeroMQ in the browser.
- hinathan 15y agoJeff and Bulat - this is fascinating and timely. Just this week I've been experimenting with bridging (Apollo) STOMP with https://github.com/wandenberg/nginx-push-stream-module https://github.com/wandenberg/nginx-push-stream-module and getting what appears to be similar results. Neat stuff, and I'm half tempted to write an nginx-STOMP bridge to save a few layers of indirection.