aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/server.rb')
-rw-r--r--lib/action_cable/server.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/action_cable/server.rb b/lib/action_cable/server.rb
index 2449837105..a0c128129d 100644
--- a/lib/action_cable/server.rb
+++ b/lib/action_cable/server.rb
@@ -24,6 +24,8 @@ module ActionCable
end
end
+ attr_reader :env
+
def initialize(env)
@env = env
end
@@ -37,6 +39,7 @@ module ActionCable
@websocket.on(:open) do |event|
broadcast_ping_timestamp
@ping_timer = EventMachine.add_periodic_timer(PING_INTERVAL) { broadcast_ping_timestamp }
+ worker_pool.async.invoke(self, :connect) if respond_to?(:connect)
end
@websocket.on(:message) do |event|
@@ -106,7 +109,7 @@ module ActionCable
def process_message(message)
if @subscriptions[message['identifier']]
- @subscriptions[message['identifier']].receive(ActiveSupport::JSON.decode message['data'])
+ @subscriptions[message['identifier']].receive_data(ActiveSupport::JSON.decode message['data'])
else
logger.error "Unable to process message: #{message}"
end