Async::Cable

Async::Cable

This is a proof-of-concept adapter for Action Cable.

The next branch tracks Rails main and relies on the ActionCable::Server::Socket abstraction introduced by rails/rails#50979. For stable Rails (≤ 8.1), use the main branch, which depends on actioncable-next.

Rails Compatibility

This branch requires unreleased Action Cable changes from Rails main, currently versioned as 8.2.0.alpha. Released Rails 8.1.x does not include ActionCable::Server::Socket; in Rails 8.1, ActionCable::Connection::Base still accepts (server, env, coder: ...) rather than (server, socket).

The gemspec therefore pins actioncable >= 8.2.0.alpha to prevent accidentally resolving against Rails 8.1.x. Once Rails ships a stable release containing rails/rails#50979, this constraint should be changed to that released version.

Development Status

Usage

Please browse the source code index or refer to the guides below.

Getting Started

This guide shows you how to add async-cable to your project to enable real-time communication between clients and servers using Falcon and Action Cable.

Releases

Please browse the releases for more details.

Unreleased

  • Add Async::Cable::Socket#raw_transmit for pushing pre-encoded payloads to the client without re-encoding. Enables "fastlane" broadcasts that encode the message once and share it across many connections.
  • Add class Async::Cable::Executor, a fiber-based replacement for ActionCable::Server::ThreadedExecutor. Tasks posted from inside a reactor run on the caller's reactor (no thread hop); tasks posted from outside, and all recurring timers, run on a dedicated reactor thread owned by the executor.

v0.3.0

  • Filter requests based on path - don't eat all inbound WebSocket connections.

v0.2.0

  • Don't close the WebSocket if it is already closed.

v0.1.0

  • Initial implementation.

Contributing

We welcome contributions to this project.

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

Running Tests

To run the test suite:

bundle exec sus

Making Releases

To make a new release:

bundle exec bake gem:release:patch # or minor or major

Developer Certificate of Origin

In order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.

Community Guidelines

This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.