New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

actioncable-next

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actioncable-next

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Action Cable Next

This gem provides the functionality of the server adapterization PR: rails/rails#50979.

See the PR description for more information on the purpose of this refactoring.

There are also some additional improvements added on top of the PR (see below).

Usage

Add this line to your application's Gemfile before Rails or Action Cable:

gem "actioncable-next"

gem "rails", "~> 7.0"

Then, you can use Action Cable as before. Under the hood, the new implementation would be used.

RSpec support

This gem also includes the corresponding patch for RSpec Rails (see PR). You MUST activate it explicitly by adding the following line to your spec/rails_helper.rb:

# after rspec-rails is loaded
require "rspec/rails"
require "action_cable/next/rspec"

New features

ActionCable.server.config.fastlane_broadcasts_enabled = true

This option allows you to enable the fast lane for broadcasting messages. When enabled, messages sent via ActionCable.server.broadcast are only decoded-encoded from/to JSON once per channel identifier and not for every connected client. This significantly reduces the broadcasting latency (up to 2x faster).

Connection#broadcast

You can now broadcast message from connection or channel instances using the connection #broadcast method. For example:

class TestChannel < ActionCable::Channel::Base
  def notify_all(data)
    connection.broadcast("testing-#{test_id}", data)
  end
end

The purpose of this interface is to avoid direct usage of server or ActionCable.server in channels code.

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc