[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Detect when a Ruby program exits

James Coglan

1/9/2009 10:28:00 AM

[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.c...

2 Answers

LAMBEAU Bernard

1/9/2009 10:37:00 AM

0

Your are probably looking for Kernel::at_exit

blambeau

On Fri, Jan 9, 2009 at 11:28 AM, James Coglan <jcoglan@googlemail.com> wrote:
> 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.c...
>

James Coglan

1/9/2009 10:49:00 AM

0

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

2009/1/9 LAMBEAU Bernard <blambeau@gmail.com>

> Your are probably looking for Kernel::at_exit



Fantastic, just what I needed. Thanks!