Forum: Ruby on Rails HOW TO DO AN APPLIFECYCLE LISTENER IN RAILS???

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A93c4933226843c95560a101b7ea1733?d=identicon&s=25 McClain (Guest)
on 2005-12-30 03:47
(Received via mailing list)
In jsp, we have applifecycle listeners. For each user that logs on, and
when
the app is started, and when session variable is changed, you can
specify a
function to run.

Is there something like this in Rails and any example code???
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2005-12-30 17:45
(Received via mailing list)
You can use Observers for most of what a lifecycle listener would be
used for.
http://www.loudthinking.com/arc/000362.html
..and pages 271 and 279 of the "Agile Web Development with Ruby on
Rails" book.

Further, because all of the Rails classes are open, you can add
callbacks or observers to pretty much anything.
Beware, though, that Rails is a share-nothing design, which means that
there isn't necessarily a single application container.
If you add code to "email the sys admin" when the app starts, he'll
get one email for every FastCGI or SCGI process that starts.
This topic is locked and can not be replied to.