AnyCable allows you to use any WebSocket server (written in any language) as a replacement for your Ruby server (such as Faye, ActionCable, etc).
AnyCable uses ActionCable protocol, so you can use ActionCable JavaScript client without any monkey-patching.
NOTE: Since version 0.4.0 this repository contains only core functionality and cannot be used separately as is. Rails plug-n-play integration has been extracted to anycable-rails gem.
- Ruby ~> 2.3
- Redis (for brodcasting, discuss other options with us!)
Read our Wiki for more.
Anycable uses anyway_config, thus it is also possible to set configuration variables through secrets.yml
or environment vars.
rpc_host: "localhost:50123"
redis_url: "redis://redis-1-1:6379/2"
redis_sentinels:
- { host: 'redis-1-1', port: 26379 }
- { host: 'redis-1-2', port: 26379 }
- { host: 'redis-1-3', port: 26379 }
This is the compatibility list for the AnyCable gem, not for AnyCable servers (which may not support some of the features yet).
Feature | Status |
---|---|
Connection Identifiers | + |
Connection Request (cookies, params) | + |
Disconnect Handling | + |
Subscribe to channels | + |
Parameterized subscriptions | + |
Unsubscribe from channels | + |
Subscription Instance Variables | - |
Performing Channel Actions | + |
Streaming | + |
Custom stream callbacks | - |
Broadcasting | + |
- Install required GRPC gems:
gem install grpc
gem install grpc-tools
- Re-generate GRPC files (if necessary):
make
Bug reports and pull requests are welcome on GitHub at https://github.com/anycable/anycable.
The gem is available as open source under the terms of the MIT License.