comet

Need help understanding Comet in Python (with Django)

淺唱寂寞╮ 提交于 2019-11-27 00:43:36
问题 After spending two entire days on this I'm still finding it impossible to understand all the choices and configurations for Comet in Python. I've read all the answers here as well as every blog post I could find. It feels like I'm about to hemorrhage at this point, so my utmost apologies for anything wrong with this question. I'm entirely new to all of this, all I've done before were simple non-real-time sites with a PHP/Django backend on Apache. My goal is to create a real-time chat

Servlet-3 Async Context, how to do asynchronous writes?

会有一股神秘感。 提交于 2019-11-26 23:48:17
问题 Problem Description Servlet-3.0 API allows to detach a request/response context and answer to it later. However if I try to write a big amount of data, something like: AsyncContext ac = getWaitingContext() ; ServletOutputStream out = ac.getResponse().getOutputStream(); out.print(some_big_data); out.flush() It may actually block - and it does block in trivial test cases - for both Tomcat 7 and Jetty 8. The tutorials recommend to create a thread pool that would handle such a setup - witch is

Django / Comet (Push): Least of all evils?

这一生的挚爱 提交于 2019-11-26 21:25:02
I have read all the questions and answers I can find regarding Django and HTTP Push. Yet, none offer a clear, concise, beginning-to-end solution about how to accomplish a basic "hello world" of so-called "comet" functionality. First question (1): To what extent is the problem that HTTP simply isn't (at least so far) made for this? Are all the potential solutions essentially hacks? 2) What's the best currently available solution? Orbited? Some other Twisted-based solution? Tornado? node.JS? XMPP w/ BOSH? Some other solution? 3) How does nginx push module play into this discussion? 4) Which of

Efficient reloading data / pushing data from server to client

做~自己de王妃 提交于 2019-11-26 20:43:35
问题 I'm looking for the 'way to go' (i.e. the most efficient, most used, general accepted way) when it comes to the reloading of data from a web server to a front end. In the end application, I will have several output fields where data has to be written to, for example like this: The data streams will be different from each other in the end application. The lines will have to be reloaded with fresh, up to date data from the server. I have been thinking of using Ajax requests to update like every

How to display HTML to the browser incrementally over a long period of time?

Deadly 提交于 2019-11-26 20:15:08
问题 Do I need to pass back any HTTP headers to tell the browser that my server won't be immediately closing the connection and to display as the HTML is received? Is there anything necessary to get the HTML to incrementally display like flush()? This technique used to be used for things like chat, but I'm thinking about using it for a COMET type application. 回答1: Long polling is a common technique to do something like this; to briefly summarise, it works as follows: The client sends an XHR to the

Stop the browser “throbber of doom” while loading comet/server push iframe

让人想犯罪 __ 提交于 2019-11-26 19:47:22
When using Comet, or Ajax Long Pull techniques - an iframe is usually used. And while that iframe is waiting for the long connection to close, the browser is spinning its throbber (the progress/loading indicator). Some websites, for example etherpad.com, managed to make it stop. How do they do it? Evgeny After digging for a day and a night in the guts of the internets, here is what I came up with: server-sent events - Very cool, currently works only in Opera, but may be part of HTML5 and other browsers may support it sometime. Adds a new element tag with content-type of "application/x-dom

Short-polling vs Long-polling for real time web applications?

天大地大妈咪最大 提交于 2019-11-26 19:43:10
I'm building a real-time web application As far as I know, the most popular choices are short-polling and long-polling. What are the advantages and disadvantages might there be for measuring one over the other? Short polling (a.k.a. AJAX based timer): Pros: simpler, not server consuming (if the time between requests is long). Cons: bad if you need to be notified WHEN the server event happens with no delay. Example ( ItsNat based) Long polling (a.k.a. Comet based on XHR) Pros: you are notified WHEN the server event happens with no delay. Cons: more complex and more server resources used.

The latest recommendation for Comet in Python? [closed]

别说谁变了你拦得住时间么 提交于 2019-11-26 15:26:25
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I'm going to be implementing Comet in Python (even though I hear good things about erlycomet I'm not thrilled about supporting an

Simple comet example using php and jquery

眉间皱痕 提交于 2019-11-26 12:06:55
问题 Can anyone give me a good and simple example of the comet technique using PHP? I just need an example that uses a persistent HTTP connection or something similar. I don\'t want to use a polling technique, because I have something like that set up and not only is it difficult to work with and manage its a big hog of resources. Also I am using IIS7 not Apache. A good example would be really helpful so I can move on from this ugly polling technique. 回答1: You should use polling, or use a web

COMET (server push to client) on iPhone [closed]

荒凉一梦 提交于 2019-11-26 10:34:02
问题 I\'m looking to establish some kind of socket/COMET type functionality from my server(s) to my iPhone application. Essentially, anytime a user manages to set an arbitrary object \'dirty\' on the server, by say, updating their Address.. the feedback should be pushed from the server to any clients keeping a live poll to the server. The buzzword for this is COMET I suppose. I know there is DWR out there for web browser applications, so I\'m thinking, maybe it\'s best to set a hidden UIWebView in