In-line the configuration points that only existed for Faye support

This commit is contained in:
Matthew Draper 2016-10-01 11:08:17 +09:30
parent d44177d45e
commit 3e779d3c67
5 changed files with 4 additions and 13 deletions

@ -57,7 +57,7 @@ def initialize(server, env, coder: ActiveSupport::JSON)
@worker_pool = server.worker_pool
@logger = new_tagged_logger
@websocket = ActionCable::Connection::WebSocket.new(env, self, event_loop, server.config.client_socket_class)
@websocket = ActionCable::Connection::WebSocket.new(env, self, event_loop)
@subscriptions = ActionCable::Connection::Subscriptions.new(self)
@message_buffer = ActionCable::Connection::MessageBuffer.new(self)

@ -4,8 +4,8 @@ module ActionCable
module Connection
# Wrap the real socket to minimize the externally-presented API
class WebSocket
def initialize(env, event_target, event_loop, client_socket_class, protocols: ActionCable::INTERNAL[:protocols])
@websocket = ::WebSocket::Driver.websocket?(env) ? client_socket_class.new(env, event_target, event_loop, protocols) : nil
def initialize(env, event_target, event_loop, protocols: ActionCable::INTERNAL[:protocols])
@websocket = ::WebSocket::Driver.websocket?(env) ? ClientSocket.new(env, event_target, event_loop, protocols) : nil
end
def possible?

@ -49,7 +49,7 @@ def remote_connections
end
def event_loop
@event_loop || @mutex.synchronize { @event_loop ||= config.event_loop_class.new }
@event_loop || @mutex.synchronize { @event_loop ||= ActionCable::Connection::StreamEventLoop.new }
end
# The worker pool is where we run connection callbacks and channel actions. We do as little as possible on the server's main thread.

@ -35,14 +35,6 @@ def pubsub_adapter
adapter = "PostgreSQL" if adapter == "Postgresql"
"ActionCable::SubscriptionAdapter::#{adapter}".constantize
end
def event_loop_class
ActionCable::Connection::StreamEventLoop
end
def client_socket_class
ActionCable::Connection::ClientSocket
end
end
end
end

@ -10,7 +10,6 @@ def initialize(subscription_adapter: SuccessAdapter)
@logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
@config = OpenStruct.new(log_tags: [], subscription_adapter: subscription_adapter)
@config.client_socket_class = ActionCable::Connection::ClientSocket
@mutex = Monitor.new
end