basho/webmachine — pull request #106 by Vagabond (2012-12-08 06:35:29+00:00)
Title: Store the dispatch_list in ETS, not application:set_env

Use a protected, named table, so everyone can read it, but only
webmachine_router can write to it. The owner of the table is
webmachine_router with the heir of the process being the supervisor.

If webmachine_router is restarted, the supervisor gives ownership of the
table to the newly spawned webmachine_router process again. This means
that routing configuration is not lost if webmachine_router crashes.

The overall goal of this is to allow webmachine routes to be unregistered in an application's prep_stop callback. Calls to applicationLset_env in prep_stop go into a message loop because the application process is busy calling prep_stop().

cc @jrwest