Detect when a Ruby program exits


#1

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


#2

Your are probably looking for Kernel::at_exit

blambeau


#3

2009/1/9 LAMBEAU Bernard removed_email_address@domain.invalid

Your are probably looking for Kernel::at_exit

Fantastic, just what I needed. Thanks!