[racket] Callback on shutdown

From: Eli Barzilay (eli at barzilay.org)
Date: Wed May 7 12:07:28 EDT 2014

Two hours ago, Matthew Flatt wrote:
> I've added `custodian-tidy-all` and related functions to
> [un]register a "tidy callback". The default exit handler calls
> `custodian-tidy-all` on the root custodian before exiting, which
> triggers all registered tidy callbacks.

It's probably a good idea to say somewhere that they're used only by
an explicit call (incl. the exit handler) and not when shutting
down...

> I found one place where I needed this before: [...]

I was curious how it works, and on a quick look it sounded like
there's a potential problem if a sandbox is registering a bad tidier.
Given that it works fine if the sandbox is explcitly killed (which is
how I ran into the above), the potential problem is pretty close to a
sandbox that gets stuck, which also requires killing.  So a possible
nice use of this is to have a new sanbox register a tidying function
that kills it (controlled by an option that is turned off for trusted
sandboxes).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140507/676dd493/attachment.html>

Posted on the users mailing list.