#214 Plugging in AnyCable
SummaryActionCable can handle quite a bit of traffic, but it gets to a point where it can become a burden on the server. With AnyCable, we can not only handle more traffic, but it is also lighter on the resources.
websockets rails 9:06
AnyCable - https://anycable.io/
# Terminal rails g channel welcome brew install anycable-go anycable-go --host=localhost --port=3334 anycable bundle exec anycable --server-command "anycable-go --host=localhost --port=3334"
# app/channels/welcome_channel.rb def subscribed stream_from "welcome_channel" end
# controllers/welcome_controller.rb def index ActionCable.server.broadcast('welcome_channel', Time.now) end
# Gemfile gem "anycable-rails" gem "redis"
# config/cable.yml development: adapter: any_cable
# config/anycable.yml development: redis_url: redis://localhost:6379/1 access_logs_disabled: false
# config/environments/development.rb config.action_cable.url = "ws://localhost:3334/cable"
# app/views/layouts/application.html.erb <%= action_cable_meta_tag %>