instance method pubsub_adapter

Ruby on Rails 5.0.7.2

Since v5.0.7.2

Available in: v5.0.7.2 v5.1.7 v5.2.8.1 v6.0.6.1 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

pubsub_adapter()

Returns constant of subscription adapter specified in config/cable.yml. If the adapter cannot be found, this will default to the Redis adapter. Also makes sure proper dependencies are required.

Source
# File actioncable/lib/action_cable/server/configuration.rb, line 24
      def pubsub_adapter
        adapter = (cable.fetch('adapter') { 'redis' })
        path_to_adapter = "action_cable/subscription_adapter/#{adapter}"
        begin
          require path_to_adapter
        rescue Gem::LoadError => e
          raise Gem::LoadError, "Specified '#{adapter}' for Action Cable pubsub adapter, but the gem is not loaded. Add `gem '#{e.name}'` to your Gemfile (and ensure its version is at the minimum required by Action Cable)."
        rescue LoadError => e
          raise LoadError, "Could not load '#{path_to_adapter}'. Make sure that the adapter in config/cable.yml is valid. If you use an adapter other than 'postgresql' or 'redis' add the necessary adapter gem to the Gemfile.", e.backtrace
        end

        adapter = adapter.camelize
        adapter = 'PostgreSQL' if adapter == 'Postgresql'
        "ActionCable::SubscriptionAdapter::#{adapter}".constantize
      end

Defined in actioncable/lib/action_cable/server/configuration.rb line 24 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionCable::Server::Configuration

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close