[racket] Callback on shutdown
Hi all,
I'm looking for an atexit()-like facility for Racket.
I've tried setting the exit-handler, but it only seems to be called when
I explicitly call exit, and not implicitly when Racket shuts down when
control flows off the end of the main program.
The problem I'm facing is to buffer rows to insert into a database, and
every few tens of milliseconds flush the buffer, thereby increasing
insertion performance.
However, I don't want to have waiting buffered rows lost at the end of
the program.
I'd like to be able to avoid having to explicitly flush the buffer
before exiting the program, so I'd like to make some kind of
atexit()-alike do it for me.
Any suggestions?
Tony