Sha256: 52a0a61c521e4d21b81f2264b1155d7220143a22482c32fad4c73d562f4c2911

Contents?: true

Size: 848 Bytes

Versions: 162

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true

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

162 entries across 157 versions & 12 rubygems

Version Path
actioncable-7.1.5 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.1.4.2 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.0.8.6 lib/action_cable/subscription_adapter/inline.rb
actioncable-6.1.7.10 lib/action_cable/subscription_adapter/inline.rb
actioncable-6.1.7.9 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.1.4.1 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.0.8.5 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.1.4 lib/action_cable/subscription_adapter/inline.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actioncable-7.0.8.4/lib/action_cable/subscription_adapter/inline.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actioncable-7.1.3.4/lib/action_cable/subscription_adapter/inline.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/actioncable-7.0.5.1/lib/action_cable/subscription_adapter/inline.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/actioncable-7.0.5.1/lib/action_cable/subscription_adapter/inline.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/actioncable-7.0.5.1/lib/action_cable/subscription_adapter/inline.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actioncable-7.1.3.4/lib/action_cable/subscription_adapter/inline.rb
actioncable-7.1.3.4 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.0.8.4 lib/action_cable/subscription_adapter/inline.rb
actioncable-6.1.7.8 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.1.3.2 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.1.3.1 lib/action_cable/subscription_adapter/inline.rb
actioncable-7.0.8.1 lib/action_cable/subscription_adapter/inline.rb