Ravi
Ravi

Reputation: 2464

Integrating Zope with socket-io

Is there a way of integrating Zope 2 (2.13.19) using Python 2.6.8 with socket-io ?

I've found https://python-socketio.readthedocs.io/en/latest/ but it doesn't seem to fit the requirement.

Upvotes: 1

Views: 117

Answers (2)

MrTango
MrTango

Reputation: 620

It seems that at least the version which is using eventlets should be possible to implement under Python 2.7. https://python-socketio.readthedocs.io/en/latest/intro.html#server-examples

What Plone version are you using?

I used a slightly different approach in the past, to realize this. I was using a small Pyramid app, which was implementing the socketio (similar to the WSGI way of this library) and was subscribing a Redis PubSub channel. Plone was using event handlers to send messages to the Redis channel which would then consumed by the Pyramid app and send to the socket.

This above library should work and the easy way to use it, would be the same way i did, as a WSGI app together with messaging.

Starting with the upcoming Plone 5.2 you can run Plone on WSGI even under Python 3. This might be a better fit, together with the WSGI app which provides the socket.io support.

The library supports also Redis for multi-server support.

Optional support for multiple servers, connected through a messaging queue such as Redis or RabbitMQ.

The integration with Zope transactions is doable, I had to do that for the Redis messages too.

in the community forum is an interesting thread on that topic too: https://community.plone.org/t/plone-socketio-websockets/6453/14

Upvotes: 0

Tiberiu Ichim
Tiberiu Ichim

Reputation: 671

Zope contains a traditional HTTP server, but you could write a ZEO client that would use the socketio library and integrate with Zope's transactions.

Upvotes: 1

Related Questions