diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-04-14 11:25:08 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-04-14 11:25:08 -0600 |
commit | 4769fc4b4d5af7a8e93cc497d744151086aa5034 (patch) | |
tree | bf3b85588cb1fc27ab6e21cc344b24e89f0ee51e /actioncable/lib | |
parent | 91798c75bc56fa706c9ed4a8dab6020462463a10 (diff) | |
parent | d1766ef53ddbd91ff414896983e8f3e6b39d2dec (diff) | |
download | rails-4769fc4b4d5af7a8e93cc497d744151086aa5034.tar.gz rails-4769fc4b4d5af7a8e93cc497d744151086aa5034.tar.bz2 rails-4769fc4b4d5af7a8e93cc497d744151086aa5034.zip |
Merge pull request #24540 from sgrif/sg-actioncable-callbacks
Run Action Cable callbacks through the worker pool
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/channel/streams.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actioncable/lib/action_cable/channel/streams.rb b/actioncable/lib/action_cable/channel/streams.rb index f654ce0bfa..8b46ac216a 100644 --- a/actioncable/lib/action_cable/channel/streams.rb +++ b/actioncable/lib/action_cable/channel/streams.rb @@ -76,8 +76,11 @@ module ActionCable # Don't send the confirmation until pubsub#subscribe is successful defer_subscription_confirmation! - if handler = callback || block - handler = -> message { handler.(coder.decode(message)) } if coder + if user_handler = callback || block + user_handler = -> message { handler.(coder.decode(message)) } if coder + handler = -> message do + connection.worker_pool.async_invoke(user_handler, :call, message) + end else handler = default_stream_handler(broadcasting, coder: coder) end |