TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Building Streaming REST APIs with Ruby

32 点作者 freeatnet大约 13 年前

4 条评论

sufianrhazi大约 13 年前
Unfortunately, this approach will not work for clients using Internet Explorer (save for IE 10). WebSockets and EventStreams are fairly new, and not supported across all browsers (both for mobile and non-mobile).<p>This is why socket.io and its contemporaries have several layers of fallbacks, even going back to infinite iframe/JSONP polling.
评论 #4020533 未加载
ericb大约 13 年前
I would suggest anyone implementing this take a look at faye-websocket. It was recently extracted from a production-quality project named Faye, which uses a pub-sub broadcast model based on bayeux. The websocket implementation has numerous fallbacks, and is well-tested. I'm using it in production currently.<p><a href="https://github.com/faye/faye-websocket-ruby" rel="nofollow">https://github.com/faye/faye-websocket-ruby</a>
评论 #4019779 未加载
lloeki大约 13 年前
Is there any information out there regarding streams / chunked responses within Rails? (I'm not talking about the new template stream facility, but generating arbitrary data)<p>I'm currently using enumerators assigned to response_body:<p><pre><code> self.status_code = 200 self.response_body = Enumerator.new { |y| ... } </code></pre> I'm hitting a number of problems though, e.g unicorn killing long-lived workers.
评论 #4019756 未加载
评论 #4019766 未加载
royalghost将近 13 年前
This is super cool.