Hook 0mq to on_* Events

48 views
Skip to first unread message

Andrew

unread,
Aug 7, 2012, 1:08:00 PM8/7/12
to gevent-...@googlegroups.com
I'm trying to setup a multi-server socket.io implementation with gevent_zeromq as the transport, but I'm having trouble figuring out where to hook in zeromq so that the following scenario is possible:

Subscribe to the same private room on multiple servers (basically setup a PUB/SUB in 0mq that matches Socketio's rooms, so clients on multiple servers can PUB to the same room and Socketio can 'emit' to that room)


I'm not worried about how to get 0mq working, but rather how to bind it to namespaced events so that all events are published to all remote servers and all remote servers have access to subscribe to any other socketio namespace/room.

I saw this example of hooking in 0mq and Socket.io, that is old and no longer works with current versions of gevent_{zeromq,socketio}: http://blog.pythonisito.com/2011/08/websockets-to-socketio.html

Thank you

Carlos Aguilar

unread,
Dec 17, 2013, 12:52:42 PM12/17/13
to gevent-...@googlegroups.com
I build an implementation from chat system without use 0mq, only with redis. When finished, this will have support for offline messages for chat users.

My implementation is under development, but I will publish few parts later.

Best Regards

Alexandre Bourget

unread,
Dec 17, 2013, 9:23:10 PM12/17/13
to gevent-...@googlegroups.com
Using 0mq, you'll need to design a simple process that will act as the "central hub" for messages.  This one will accept all the publishers' messages, and forward to those subscribed.  That means a pair per socket.io nodes.  Using Redis for that use case is good, since it provides with an already-implemented solution.  Something like RabbitMQ would also do the job, but would be slightly more complex.

Alexandre



--
You received this message because you are subscribed to the Google Groups "gevent-socketio" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gevent-socketio/-/uJP-uBACs0wJ.
To post to this group, send email to gevent-...@googlegroups.com.
To unsubscribe from this group, send email to gevent-socket...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gevent-socketio?hl=en.

Reply all
Reply to author
Forward
0 new messages