Forum: Ruby on Rails ActionController::Live in development without "config.cache_classes = true"?

37905ed02240846d5845881a0996f8ea?d=identicon&s=25 Maximilian Busch (Guest)
on 2013-08-15 21:19
(Received via mailing list)
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 :-)
7f1329bd459ddf64ac4c0092d09206ee?d=identicon&s=25 Kristijan Sedlak (Guest)
on 2014-04-02 08:16
(Received via mailing list)
+1
7f1329bd459ddf64ac4c0092d09206ee?d=identicon&s=25 Kristijan Sedlak (Guest)
on 2014-04-02 08:16
(Received via mailing list)
Just add config.allow_concurrency = true to your development.rb.
37905ed02240846d5845881a0996f8ea?d=identicon&s=25 Maximilian Busch (Guest)
on 2014-04-02 14:48
(Received via mailing list)
Thanks for heading back here, Kristijan - I'll go with that setting once
I've some resources available to test this.

Am Mittwoch, 2. April 2014 00:57:09 UTC+2 schrieb Kristijan Sedlak:
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.