Rails 3.1 中的 HTTP 流可以与 Thin 配合使用吗?

发布于 2024-11-09 12:03:32 字数 547 浏览 3 评论 0原文

Rails 3.1 支持 HTTP 流,但仅限于兼容的 Web 服务器。宣布 3.1 候选版本的博客文章提到了 Unicorn: http://weblog.rubyonrails.org/2011/5 /22/rails-3-1-release-candidate

API 文档还提到了 Unicorn,并且有一个 Passenger 的存根: https://github.com/rails/rails /blob/master/actionpack/lib/action_controller/metal/streaming.rb

有谁知道是否支持 Thin,如果支持,我在哪里可以找到配置信息?

Rails 3.1 supports HTTP streaming, but only with compatible web servers. The blog post announcing the 3.1 release candidate mentions Unicorn:
http://weblog.rubyonrails.org/2011/5/22/rails-3-1-release-candidate

And the API docs also mention Unicorn, and have a stub for Passenger:
https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/streaming.rb

Does anyone know if Thin is supported, and if so, where I can find configuration info?

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

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

发布评论

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

评论(1

濫情▎り 2024-11-16 12:03:32

在 0.5.4 版本的发行说明中:

    == 0.5.4 Flying Mustard release
     * Don't read the full body, use direct streaming when sending response.
       See: Response#each
       As a result, the Content-Length can not be calculated anymore.
       You have to do set this in your adapter. All frameworks do it anyway.
       It improve memory usage and boost speed for low concurrency.
       Thanks to Kent Sibilev and Ezra for their help on that one.

但是,当我运行两个瘦实例(在不同端口上,其中一个设置为资源主机)时,布局中的 CSS 和 JS 在 sleep 控制器操作中的调用已完成执行。这是在生产模式下完成的。

我不是 100% 确定它的机制,也许需要设置薄机架适配器才能允许流式传输。

In the release notes for the 0.5.4 release:

    == 0.5.4 Flying Mustard release
     * Don't read the full body, use direct streaming when sending response.
       See: Response#each
       As a result, the Content-Length can not be calculated anymore.
       You have to do set this in your adapter. All frameworks do it anyway.
       It improve memory usage and boost speed for low concurrency.
       Thanks to Kent Sibilev and Ezra for their help on that one.

However when I ran two thin instances (on different ports, one set as the asset host), the CSS and JS in the layout were not loaded before the sleep call in the controller action had finished executing. This was done in production mode.

I'm not 100% sure of the mechanics of it, perhaps the Thin rack-adapter needs to be setup to allow streaming.

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