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).
____________________ Racket Users list: http://lists.racket-lang.org/users