aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/subscription_adapter/async.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-01-24 22:30:48 +1030
committerMatthew Draper <matthew@trebex.net>2016-01-24 22:30:48 +1030
commitdcdadd5e82eed2e64d21399599b14501c3e16cc3 (patch)
tree1ec70f6e5357ee6ac58c0913ad67bf046ded7e17 /actioncable/lib/action_cable/subscription_adapter/async.rb
parente3a0ad83da16f5fb063ce7d254b4e466baf7199d (diff)
parent9ff28c10ebad0d4781603499a3e3b1d7fd5fbd2c (diff)
downloadrails-dcdadd5e82eed2e64d21399599b14501c3e16cc3.tar.gz
rails-dcdadd5e82eed2e64d21399599b14501c3e16cc3.tar.bz2
rails-dcdadd5e82eed2e64d21399599b14501c3e16cc3.zip
Merge pull request #23217 from matthewd/adapter-tests
ActionCable Adapter tests
Diffstat (limited to 'actioncable/lib/action_cable/subscription_adapter/async.rb')
-rw-r--r--actioncable/lib/action_cable/subscription_adapter/async.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/actioncable/lib/action_cable/subscription_adapter/async.rb b/actioncable/lib/action_cable/subscription_adapter/async.rb
new file mode 100644
index 0000000000..85d4892e4c
--- /dev/null
+++ b/actioncable/lib/action_cable/subscription_adapter/async.rb
@@ -0,0 +1,22 @@
+require 'action_cable/subscription_adapter/inline'
+
+module ActionCable
+ module SubscriptionAdapter
+ class Async < Inline # :nodoc:
+ private
+ def subscriber_map
+ @subscriber_map ||= AsyncSubscriberMap.new
+ end
+
+ class AsyncSubscriberMap < SubscriberMap
+ def add_subscriber(*)
+ ::EM.next_tick { super }
+ end
+
+ def invoke_callback(*)
+ ::EM.next_tick { super }
+ end
+ end
+ end
+ end
+end