aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/subscription_adapter/async.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-03-02 11:20:19 +1030
committerMatthew Draper <matthew@trebex.net>2016-03-02 12:17:15 +1030
commita373be9da45d4bee684ea03420212780ec1ef4b1 (patch)
tree3798c6117d8944189c84bd5363d49dbf935ea407 /actioncable/lib/action_cable/subscription_adapter/async.rb
parent541e4abb4b3710a384aefac83cafd0ab878c60bf (diff)
downloadrails-a373be9da45d4bee684ea03420212780ec1ef4b1.tar.gz
rails-a373be9da45d4bee684ea03420212780ec1ef4b1.tar.bz2
rails-a373be9da45d4bee684ea03420212780ec1ef4b1.zip
Support faye-websocket + EventMachine as an option
Diffstat (limited to 'actioncable/lib/action_cable/subscription_adapter/async.rb')
-rw-r--r--actioncable/lib/action_cable/subscription_adapter/async.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/actioncable/lib/action_cable/subscription_adapter/async.rb b/actioncable/lib/action_cable/subscription_adapter/async.rb
index cca6894289..10b3ac8cd8 100644
--- a/actioncable/lib/action_cable/subscription_adapter/async.rb
+++ b/actioncable/lib/action_cable/subscription_adapter/async.rb
@@ -5,16 +5,21 @@ module ActionCable
class Async < Inline # :nodoc:
private
def new_subscriber_map
- AsyncSubscriberMap.new
+ AsyncSubscriberMap.new(server.event_loop)
end
class AsyncSubscriberMap < SubscriberMap
+ def initialize(event_loop)
+ @event_loop = event_loop
+ super()
+ end
+
def add_subscriber(*)
- Concurrent.global_io_executor.post { super }
+ @event_loop.post { super }
end
def invoke_callback(*)
- Concurrent.global_io_executor.post { super }
+ @event_loop.post { super }
end
end
end