New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Action Cable to rails/master #22585
Conversation
@lifo I couldn’t find any use of documentation for this, so removed it for now. Was it just for testing?
We have the remote connections to immediately cut a connection when someone has been kicked off. Let’s lean on that for now.
Update README find_verified_user example
…to_readme README.md instructions for configuring allowed request origins
Handle cases where logger is not a tagged logger.
Fix an error when using multiple gid identifiers
…mode Add logging to stdout in development mode.
Allow regexp for a allowed_request_origins array
Easy websocket url configuration
add devise example to readme
Freshen up the client-side subscription examples. Fixes #118
@@ -361,6 +390,7 @@ DEPENDENCIES | |||
rails! | |||
rake (>= 10.3) | |||
redcarpet (~> 3.2.3) | |||
redis (~> 3.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we never solved this problem, what do you think about having actioncable
be in the default Gemfile
instead? We probably shouldn't have the rails
gem have a hard dependency on redis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make redis "optional" in the same way that mysql or postgresql is optional for activerecord. So a run-time requirement. But Action Cable ships with Rails by standard, not in the Gemfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that'll work here, since we conditionally require the adapter based on the configuration, but Action Cable will always end up being required. I'm concerned that this will cause a large number of existing apps to be unable to upgrade by default, if Redis isn't already installed on the machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the redis requirement can just kick in when we start the server
with ./bin/cable or whatever. And then the redis gem file can be listed by
default in the default Gemfile for new apps. And if someone tries to start
bin/cable without that, we'll complain about why.
On Mon, Dec 14, 2015 at 4:57 PM, Sean Griffin notifications@github.com
wrote:
In Gemfile.lock
#22585 (comment):@@ -361,6 +390,7 @@ DEPENDENCIES
rails!
rake (>= 10.3)
redcarpet (~> 3.2.3)
- redis (~> 3.0)
I'm not sure that'll work here, since we conditionally require the adapter
based on the configuration, but Action Cable will always end up being
required. I'm concerned that this will cause a large number of existing
apps to be unable to upgrade by default, if Redis isn't already installed
on the machine.—
Reply to this email directly or view it on GitHub
https://github.com/rails/rails/pull/22585/files#r47514517.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhh I think this would work. Will this have any after effects when someone is trying to upgrade from 4.2.x to 5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I think whatever strategy we apply for redis
should also be used for eventmachine
as it's pretty heavyweight as well. We should see if we can drop the dependency on coffee-rails
as well, as that's not something that rails
currently has a dependency.
Massive and amazing! |
like Unicorn, but the latter must be multi-threaded, like Puma. | ||
|
||
|
||
## Alpha disclaimer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhh Some sections of this README need to be revised for ActionCable to become part of Rails (such as this Alpha disclaimer).
Would you like me to open a PR against your branch with the suggested changes?
Should I also truncate the lines of the README following Rails conventions?
We need a railtie for action cable. We need to change All these missing things will address the @sgrif comment about redis being required. |
@@ -64,6 +64,17 @@ group :job do | |||
gem 'sequel', require: false | |||
end | |||
|
|||
# Action Cable | |||
group :cable do | |||
gem 'faye-websocket', '~> 0.10.0', require: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove all these dependencies but puma from here. They are all in the gemspec.
Closed in favor of #22586. |
config.action_cable = ActiveSupport::OrderedOptions.new | ||
|
||
config.to_prepare do | ||
ApplicationController.helper ActionCable::Helpers::ActionCableHelper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include in ActionView::Base
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes more sense. Should be available everywhere.
On Mon, Dec 14, 2015 at 5:24 PM, Rafael França notifications@github.com
wrote:
In actioncable/lib/action_cable/engine.rb
#22585 (comment):@@ -0,0 +1,27 @@
+require 'rails/engine'
+require 'active_support/ordered_options'
+require 'action_cable/helpers/action_cable_helper'
+
+module ActionCable
- class Engine < ::Rails::Engine
- config.action_cable = ActiveSupport::OrderedOptions.new
- config.to_prepare do
ApplicationController.helper ActionCable::Helpers::ActionCableHelper
Should we include in ActionView::Base?
—
Reply to this email directly or view it on GitHub
https://github.com/rails/rails/pull/22585/files#r47518344.
It Is Time.