Twitter在w3c上流式传输API的方法 [英] Twitter's method for streaming API on w3c

查看:167
本文介绍了Twitter在w3c上流式传输API的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣构建类似于Twitter构建的流API(只读)。数据将仅从服务器到客户端单向传输。客户端不一定是Web浏览器,而只是技术上可以保持持久HTTP连接打开的任何东西。我很确定Twitter的流API正在做的不是WebSockets而不是COMET。我想知道他们部署的技术/策略是否具有可以学习的w3c规范。我不一定看到他们在W3C上的策略有任何链接 - 所以它可能是自定义的东西,但是在理解构建这个服务器端HTTP流支持所涉及的流行语和协议的正确方向上的任何一点都会很棒。

I am interested in building a streaming API (read-only) similar to what Twitter has built. Data will only be going unidirectional, from server to client. Clients do not have to be web browsers but merely anything that can technically keep a persistent HTTP connection open. I'm fairly certain what Twitter's streaming API is doing is not WebSockets and not COMET. I was wondering if the technology/strategy that they deployed is one with a w3c specification that one can study. I don't necessarily see any links to their strategy on W3C - so it might be something "custom" but any point in the right direction to understanding the buzzwords and protocols involved to building this server side HTTP streaming support would be great.

推荐答案

Twitter的实现使用自定义协议,但它在精神上与w3c-standard相似服务器发送事件。服务器发送的事件比websockets简单得多,但只允许在一个方向上进行通信。在对Tornado的拉动请求。

Twitter's implementation uses a custom protocol, but it's similar in spirit to the w3c-standard Server-Sent Events. Server-sent events are much simpler than websockets, but only allow communication in one direction. There is a python implementation of the server side of the protocol in this pull request for Tornado.

这篇关于Twitter在w3c上流式传输API的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆