Detect when a Ruby program exits

J

James Coglan

[Note: parts of this message were removed to make it a legal post.]

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
 
J

James Coglan

[Note: parts of this message were removed to make it a legal post.]

2009/1/9 LAMBEAU Bernard said:
Your are probably looking for Kernel::at_exit



Fantastic, just what I needed. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top