aboutsummaryrefslogblamecommitdiffstats
path: root/actioncable/lib/action_cable/subscription_adapter/async.rb
blob: c88b03947a3df9e61df4811770d713d50f5c7739 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                    
                                                        


                                
                                                        




             
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(*)
            Concurrent.global_io_executor.post { super }
          end

          def invoke_callback(*)
            Concurrent.global_io_executor.post { super }
          end
        end
    end
  end
end