aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2015-06-21 19:47:36 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2015-06-21 19:47:36 +0200
commite2a5a323fd1764c8a2b8d34ebfde65e527a1aedd (patch)
tree7e383f265a90cd186f96abc691ee375263c3c43a /lib/action_cable
parent829ae0b2e2cbd580a89a933ce032dae30aa34629 (diff)
downloadrails-e2a5a323fd1764c8a2b8d34ebfde65e527a1aedd.tar.gz
rails-e2a5a323fd1764c8a2b8d34ebfde65e527a1aedd.tar.bz2
rails-e2a5a323fd1764c8a2b8d34ebfde65e527a1aedd.zip
Homogenize lifecycle method names
Active, present voice.
Diffstat (limited to 'lib/action_cable')
-rw-r--r--lib/action_cable/connection/base.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb
index 89d0844031..2ca284b62f 100644
--- a/lib/action_cable/connection/base.rb
+++ b/lib/action_cable/connection/base.rb
@@ -44,7 +44,7 @@ module ActionCable
if message.is_a?(String)
if @accept_messages
- worker_pool.async.invoke(self, :received_data, message)
+ worker_pool.async.invoke(self, :receive_data, message)
else
@pending_messages << message
end
@@ -54,7 +54,7 @@ module ActionCable
@websocket.on(:close) do |event|
logger.info finished_request_message
- worker_pool.async.invoke(self, :on_connection_closed)
+ worker_pool.async.invoke(self, :close_connection)
EventMachine.cancel_timer(@ping_timer) if @ping_timer
end
@@ -64,7 +64,6 @@ module ActionCable
end
end
- def received_data(data)
return unless websocket_alive?
data = ActiveSupport::JSON.decode data
@@ -76,6 +75,7 @@ module ActionCable
unsubscribe_channel(data)
when 'message'
process_message(data)
+ def receive_data(data)
else
logger.error "Received unrecognized command in #{data.inspect}"
end
@@ -124,10 +124,10 @@ module ActionCable
subscribe_to_internal_channel
@accept_messages = true
- worker_pool.async.invoke(self, :received_data, @pending_messages.shift) until @pending_messages.empty?
+ worker_pool.async.invoke(self, :receive_data, @pending_messages.shift) until @pending_messages.empty?
end
- def on_connection_closed
+ def close_connection
server.remove_connection(self)
cleanup_subscriptions