Forum: Ruby Detect when a Ruby program exits

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.
53581739a445ad78250a676dabddf55f?d=identicon&s=25 James Coglan (Guest)
on 2009-01-09 11:28
(Received via mailing list)
Hi all,

Is there a way to have your code notified when a Ruby process is
terminated?
I'm looking for a way to serialize a bunch of in-memory data to disk
automatically when a Rails app is shut down. I might be better off
storing
it in SQLite but would like to know if the in-memory option is possible
first.

Thanks,
James
http://github.com/jcoglan
F1938de600a3feacd015051492fdaf0f?d=identicon&s=25 LAMBEAU Bernard (Guest)
on 2009-01-09 11:37
(Received via mailing list)
Your are probably looking for Kernel::at_exit

blambeau
53581739a445ad78250a676dabddf55f?d=identicon&s=25 James Coglan (Guest)
on 2009-01-09 11:50
(Received via mailing list)
2009/1/9 LAMBEAU Bernard <blambeau@gmail.com>

> Your are probably looking for Kernel::at_exit



Fantastic, just what I needed. Thanks!
This topic is locked and can not be replied to.