#214 Plugging in AnyCable

Summary

ActionCable 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

Resources

AnyCable - https://anycable.io/

Summary

Terminalrails 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/javascript/channels/welcome_channel.jsreceived(data) {
  // Called when there's incoming data on the websocket for this channel
  console.log(data)
}
app/channels/welcome_channel.rbdef subscribed
  stream_from "welcome_channel"
end
controllers/welcome_controller.rbdef index
  ActionCable.server.broadcast('welcome_channel', Time.now)
end
Gemfilegem "anycable-rails"
gem "redis"
config/cable.ymldevelopment:
  adapter: any_cable
config/anycable.ymldevelopment:
  redis_url: redis://localhost:6379/1
  access_logs_disabled: false
config/environments/development.rbconfig.action_cable.url = "ws://localhost:3334/cable"
app/views/layouts/application.html.erb<%= action_cable_meta_tag %>


[email protected] PRO said 16 days ago on Plugging in AnyCable :

Video duration is ZERO (0) minute. :-)

kobaltz PRO said 16 days ago on Plugging in AnyCable :

Sorry about that. It's fixed now.

[email protected] PRO said 16 days ago on Plugging in AnyCable :

does not play??

kobaltz PRO said 16 days ago on Plugging in AnyCable :

Sorry about that. It's fixed now.

[email protected] PRO said 6 days ago on Plugging in AnyCable :

Thank you ... appreciate that ... its a good Video.

Login to Comment