【问题标题】:Integrating Zope with socket-io将 Zope 与 socket-io 集成
【发布时间】:2018-12-06 15:18:30
【问题描述】:

有没有办法使用 Python 2.6.8 和 socket-io 集成 Zope 2 (2.13.19)?

我找到了https://python-socketio.readthedocs.io/en/latest/,但它似乎不符合要求。

【问题讨论】:

    标签: socket.io plone python-2.6 zope gevent-socketio


    【解决方案1】:

    Zope 包含一个传统的 HTTP 服务器,但您可以编写一个 ZEO 客户端,该客户端将使用 socketio 库并与 Zope 的事务集成。

    【讨论】:

      【解决方案2】:

      似乎至少使用 eventlet 的版本应该可以在 Python 2.7 下实现。 https://python-socketio.readthedocs.io/en/latest/intro.html#server-examples

      你用的是什么Plone版本?

      我过去使用了一种稍微不同的方法来实现这一点。我正在使用一个小的 Pyramid 应用程序,它实现了 socketio(类似于这个库的 WSGI 方式)并订阅了一个 Redis PubSub 频道。 Plone 使用事件处理程序将消息发送到 Redis 通道,然后由 Pyramid 应用程序使用并发送到套接字。

      上面的这个库应该可以工作并且使用它的简单方法,就像我做的一样,作为一个带有消息传递的 WSGI 应用程序。

      从即将推出的 Plone 5.2 开始,您甚至可以在 Python 3 下在 WSGI 上运行 Plone。这可能更适合与提供 socket.io 支持的 WSGI 应用程序一起使用。

      该库还支持 Redis 以实现多服务器支持。

      可选支持多个服务器,通过 Redis 或 RabbitMQ 等消息队列连接。

      与 Zope 事务的集成是可行的,我也必须为 Redis 消息这样做。

      在社区论坛中也有关于该主题的有趣主题: https://community.plone.org/t/plone-socketio-websockets/6453/14

      【讨论】:

        猜你喜欢
        • 2015-06-14
        • 2022-01-20
        • 1970-01-01
        • 1970-01-01
        • 2020-10-11
        • 2017-03-16
        • 1970-01-01
        • 2015-05-22
        • 1970-01-01
        相关资源
        最近更新 更多