Sha256: 50d7f1367b9f2b9ef8037c94a854f7e8b36670666fa26b884f2b3076d7ff4cc9

Contents?: true

Size: 817 Bytes

Versions: 53

Compression:

Stored size: 817 Bytes

Contents

module ActionCable
  module SubscriptionAdapter
    class Inline < Base # :nodoc:
      def initialize(*)
        super
        @subscriber_map = nil
      end

      def broadcast(channel, payload)
        subscriber_map.broadcast(channel, payload)
      end

      def subscribe(channel, callback, success_callback = nil)
        subscriber_map.add_subscriber(channel, callback, success_callback)
      end

      def unsubscribe(channel, callback)
        subscriber_map.remove_subscriber(channel, callback)
      end

      def shutdown
        # nothing to do
      end

      private
        def subscriber_map
          @subscriber_map || @server.mutex.synchronize { @subscriber_map ||= new_subscriber_map }
        end

        def new_subscriber_map
          SubscriberMap.new
        end
    end
  end
end

Version data entries

53 entries across 53 versions & 4 rubygems

Version Path
actioncable-5.1.7 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.7.rc1 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.6.2 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.7.2 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.6.1 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.7.1 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.6 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.7 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.5 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.5.rc1 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.4 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.6 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.4.rc1 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.6.rc1 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.3 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.3.rc3 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.5 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.5.rc2 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.1.3.rc2 lib/action_cable/subscription_adapter/inline.rb
actioncable-5.0.5.rc1 lib/action_cable/subscription_adapter/inline.rb