aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/server
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-07-04 08:44:14 +0930
committerGitHub <noreply@github.com>2016-07-04 08:44:14 +0930
commit08a907461341486e371774dd69c43852657c0f4f (patch)
tree201c34191879ad92a8f39901ba10aa6e4fd80dbe /actioncable/lib/action_cable/server
parent550303c05c48f17b699a13258608e04bf63cf0e8 (diff)
parentf3ba0c1dd32821ad700b2784d160d1c161fb3125 (diff)
downloadrails-08a907461341486e371774dd69c43852657c0f4f.tar.gz
rails-08a907461341486e371774dd69c43852657c0f4f.tar.bz2
rails-08a907461341486e371774dd69c43852657c0f4f.zip
Merge pull request #24988 from mwear/action_cable_broadcast_notifications
Add ActiveSupport::Notifications hook to ActionCable::Server.broadcast
Diffstat (limited to 'actioncable/lib/action_cable/server')
-rw-r--r--actioncable/lib/action_cable/server/broadcasting.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actioncable/lib/action_cable/server/broadcasting.rb b/actioncable/lib/action_cable/server/broadcasting.rb
index 8f93564113..1fc58baa3e 100644
--- a/actioncable/lib/action_cable/server/broadcasting.rb
+++ b/actioncable/lib/action_cable/server/broadcasting.rb
@@ -39,8 +39,12 @@ module ActionCable
def broadcast(message)
server.logger.info "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect}"
- encoded = coder ? coder.encode(message) : message
- server.pubsub.broadcast broadcasting, encoded
+
+ payload = { broadcasting: broadcasting, message: message, coder: coder }
+ ActiveSupport::Notifications.instrument("broadcast.action_cable", payload) do
+ encoded = coder ? coder.encode(message) : message
+ server.pubsub.broadcast broadcasting, encoded
+ end
end
end
end