Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionController::Live + Redis issue

I'm in the process of developing a Rails app which uses ActionController::Live, and the action in that controller is set to subscribe to Redis Pub/Sub.

It's pretty much the same method described here - http://www.beilabs.com/2013/05/02/redis-pub-sub-and-rails-4-streaming

The problem is, in development, whenever the live action is called, the whole app freezes and stops serving requests. I can't figure out why.

Any help will be greatly appreciated.

like image 587
user2833253 Avatar asked Feb 14 '26 05:02

user2833253


1 Answers

make sure that you these are set in your config/environments/development.rb

config.cache_classes = true
config.eager_load = true

when playing with live streaming. This will mean that you have to restart your rails server whenever you make a change though.

You'll probably want to look into setting up guard to automatically restart your server on file changes.

Alternatively, look into the existing guard gems like guard-rails, guard-puma, or guard-zeus.

like image 52
Johnny Robeson Avatar answered Feb 15 '26 19:02

Johnny Robeson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!