开发者

Live stream 'push' with Ajax

I just found an interesting demo of what can be done with the cappuccino framework;

Push with Cappuccino and Tornado

As far as I understands it, It keeps an async client/server connecti开发者_StackOverflowon, which is great to keep a "content" updated.

I would like to know if there is any way I can do the same thing using JQuery or another library. Cappuccino looks a bit like a all-or-nothing framework.


What you are seeing there is not particular to cappucino or Tornado: its an example of HTTP long-polling to simulate async connections. Essentailly a client makes a request to the server with a very long (or infinite) timeout and the server responds when it has some data.

It's a workaround for the fact that until very recently there was no way for a browser to receive a request from a web-server. This is changing as the most recent web-standards are gaining adoption.

In short, there is nothing to stop you employing this kind of technique in any framework. Take a look at the wikipedia page on Comet for more info.

In your specific case, you might find the answers on this question helpful as they are specific to jQuery.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜