选择和部署 Comet 服务器

发布于 2024-07-14 20:54:54 字数 215 浏览 6 评论 0原文

我想通过 HTTP 将数据推送到浏览器而不终止我的 django/python 应用程序。

我决定使用彗星服务器来代理我的应用程序和客户端之间的请求(尽管我仍然没有真正弄清楚它)。

我研究了以下引擎: 绕轨道运行 彗星 埃贾伯德 jetty

有人有使用这些服务器并部署它们的经验吗? 有关该主题的任何见解和链接都会很棒。 谢谢。

I want to push data to the browser over HTTP without killing my django/python application.

I decided to use a comet server, to proxy requests between my application and the client (though I still haven't really figured it out properly).

I've looked into the following engines:
orbited
cometd
ejabberd
jetty

Has anyone had any experience working with these servers and deploying them? Any insight and links regarding the topics would be great. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

九歌凝 2024-07-21 20:54:54

我建议您研究一下 Twisted,他们的twisted.web 服务器,以及在 Divmod 上在其之上完成的 comet 工作。 与传统的基于线程或进程的服务器相比,它们可以处理更多的并发连接,这正是您所需要的。 是的,我已经使用 Twisted 来构建 COMET 的系统,同时使用其他东西来构建更前端的 Web 应用程序。 每个部分都尽其所能,效果很好。

I would recommend looking into Twisted, their twisted.web server, and the comet work done on top of it at Divmod. They can handle far more concurrent connections than traditional thread or process based servers, which is exactly what you need for something like this. And, yes, I've architected systems using Twisted for COMET stuff, while using other things for the more front-facing web applications beside it. It works out well with each part doing what it does best.

戴着白色围巾的女孩 2024-07-21 20:54:54

我需要做一些非常类似的事情。 我发现了这个,但还没有时间正确地查看它:

django_evserver 是简单的 http 服务器
用于 Django 应用程序。 它基于
libevent 库。 主要优点
django_evserver 的特点是它提供了
抢占 django 视图的方法。
您可以通过多种方式呈现一个站点
块,每个块都可以由
不同的 Django 视图。

利用这个想法,可以使用
django_evserver 作为 comet 服务器
Django 应用程序。

http://code.google.com/p/django-evserver/

I need to do something very similar. I found this, but haven't had the time to look at it properly yet:

django_evserver is simple http server
for Django applications. It's based on
libevent library. The main advantage
of django_evserver is that it provides
methods of preempting django views.
You can render a site in several
chunks, each of them can be handled by
different django view.

Using this idea it's possible to use
django_evserver as comet server for
django applications.

http://code.google.com/p/django-evserver/

七秒鱼° 2024-07-21 20:54:54

一种选择是 Netty,它是基于 JBoss 的 Java NIO 的客户端-服务器套接字框架。 有关比较和讨论请参见此处。 据报道,它可以在四核服务器上同时处理 100000 个打开连接。

One option is Netty, client-server socket framework based on Java NIO from JBoss. For a comparison and discussion see here. It reportedly handles 100000 simultaneous open connections on a quad-core server.

最舍不得你 2024-07-21 20:54:54

如果您可以运行 Java,我会推荐 StreamHub Comet Server

首先,考虑到您不需要“杀死”现有应用程序,JavaScript 包含的占用空间非常小,不到 10K。 我用它来推送用户更新并在我正在构建的社交网站上聊天。 我测试了一天超过 1000 次点击,对 CPU 没有明显影响。

其次,在部署时,我遵循了一些示例,并且与使用 CometD 将头撞到墙上相比,我的启动和运行速度非常快。 有一个很好的 Comet Hello World入门指南和 Google 网上论坛(如果您遇到困难) 。

If you can run Java I would recommend StreamHub Comet Server.

Firstly, regarding your need not to 'kill' your existing application, the JavaScript include has a really low footprint at less than 10K. I use it for pushing user updates and chat on the social networking site I'm building. I tested with a 1000+ hits a day and there was no noticeable effect on the CPU.

Secondly, on deploying, I followed some of the examples and was up and running really quickly compared to banging my head against a wall with CometD. There is a good Comet Hello World getting started guide and a Google Group if you get stuck on anything.

小情绪 2024-07-21 20:54:54

如果您希望将 Django 与 Comet 服务器(Orbited)结合起来,请检查这个项目,我将在这里尽可能“干净”和“真实世界”地集成 Django 和 Orbited:http://github.com/clemesha/hotdot

该项目解决了“现实世界”的问题,例如安全性和日志记录/过滤/修改-传输彗星消息等 - 但仍在进行中。

If you're looking to combine Django with a Comet server (Orbited), check this project I have going to integrate Django and Orbited in as "clean" and "real-world" as possible here: http://github.com/clemesha/hotdot

The project addresses "real-world" problems like security and logging/filtering/modifying the in-transit Comet messages, etc - but is still a work in progress.

中二柚 2024-07-21 20:54:54

If you're running IIS, you can check out WebSync (http://www.frozenmountain.com/websync), a standards-compliant (bayeux) comet server and client for .NET/IIS. If you don't want the additional load, the On-Demand version is a SaaS option that offloads the heavy lifting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文