Hey all,
we recently ported to Rails 4.0 from 3.2.13 with our application and
were
really excited about the new ActionController::Live functionalities.
Part
of our application is a messaging/notification system and we wanted to
implement a live notification when a new message reaches the inbox of a
user. To create not too much overhead we decided to implement some lame
JavaScript polling function that checks for new messages every 15
seconds -
not that fancy in my opinion
With ActionController::Live and Server-Sent Events (in combination with
Redis) we were hoping to have found a good solution with not too much
overhead. Maybe some of you know that for this to work you canāt go with
the WebRICK web server - but we were fine to go with Puma.
But what really bugs me: You need to set āconfig.cache_classesā and
āconfig.eager_loadā to ātrueā for your development environment to let
this
combination (mentioned above) work out. That means that in development
you
have to restart the web server (Puma) each time you want code changes to
be
applied.
Did anyone else encounter these uncomfortable workflow? Is anybody out
there who can give me some point to think forward from to find a
solution
for this?
Right now weāre thinking of a (very, very, very) bad hack: Activate the
old-style polling based on JS within development environment to somehow
verify that message notifications are send without a page reload and
donāt
use the ActionController::Live - and go with the good solution in the
production environment.
In my opinion I would rather go with a better solution for development
ā¦
I would really appreciate any input on this topic