aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/server/configuration.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-03-04 05:31:48 +1030
committerMatthew Draper <matthew@trebex.net>2016-03-04 05:31:48 +1030
commitbbba0649f529626a076c4247047b60cfbe86d5e4 (patch)
treecdbf52c160399441574d1f13dd6587ee504e002d /actioncable/lib/action_cable/server/configuration.rb
parentcd73632d9d47752013f46e775e59241215cfd8e9 (diff)
parenta373be9da45d4bee684ea03420212780ec1ef4b1 (diff)
downloadrails-bbba0649f529626a076c4247047b60cfbe86d5e4.tar.gz
rails-bbba0649f529626a076c4247047b60cfbe86d5e4.tar.bz2
rails-bbba0649f529626a076c4247047b60cfbe86d5e4.zip
Merge pull request #23992 from matthewd/em-option
Support faye-websocket + EventMachine as an option
Diffstat (limited to 'actioncable/lib/action_cable/server/configuration.rb')
-rw-r--r--actioncable/lib/action_cable/server/configuration.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/actioncable/lib/action_cable/server/configuration.rb b/actioncable/lib/action_cable/server/configuration.rb
index 9a7301287c..5fe71caed2 100644
--- a/actioncable/lib/action_cable/server/configuration.rb
+++ b/actioncable/lib/action_cable/server/configuration.rb
@@ -4,7 +4,7 @@ module ActionCable
# in a Rails config initializer.
class Configuration
attr_accessor :logger, :log_tags
- attr_accessor :connection_class, :worker_pool_size
+ attr_accessor :use_faye, :connection_class, :worker_pool_size
attr_accessor :disable_request_forgery_protection, :allowed_request_origins
attr_accessor :cable, :url, :mount_path
@@ -43,6 +43,22 @@ module ActionCable
adapter = 'PostgreSQL' if adapter == 'Postgresql'
"ActionCable::SubscriptionAdapter::#{adapter}".constantize
end
+
+ def event_loop_class
+ if use_faye
+ ActionCable::Connection::FayeEventLoop
+ else
+ ActionCable::Connection::StreamEventLoop
+ end
+ end
+
+ def client_socket_class
+ if use_faye
+ ActionCable::Connection::FayeClientSocket
+ else
+ ActionCable::Connection::ClientSocket
+ end
+ end
end
end
end