basho/webmachine — pull request #128 by seancribbs (2013-02-22 16:48:43+00:00)
Title: Bugfix for multiple routers under Riak

The previous addition of multiple routers -- for the benefit of launching multiple applications -- assumed that any process calling `webmachine_mochiweb:start/1` would give its name as the name of a router process. However, in `riak_core`, the name given is:

1. A string, which is not a valid registered name.
2. Related to the interface/port on which the mochiweb listener binds, not the dispatch list.

This PR changes the behavior of multiple dispatch lists slightly such that:

1. There is only one `webmachine_router` process, but it has multiple dispatch lists in its ETS table. Since the table is public, we don't need to run multiple routers, just have a way to access the dispatch lists by name.
2. The desired dispatch list name is given as the `router_name` option, defaulting to `webmachine_router`. The `name` option given to `webmachine_mochiweb:start/1` is used ONLY as part of the listener process name, defaulting to `webmachine_mochiweb`.