ferd/dispcount — pull request #5 by loucash (2014-11-10 14:37:08+00:00)
Title: Unique registered names of workers

@ferd Hey, I was evaluating `dispcount` application and I noticed that it will be impossible to create two named-based dispatchers, because workers names are based on `?MODULE` which is `dispcount_watcher`.

Simple test:
```erlang
1> application:start(dispcount). ok
2> ok = dispcount:start_dispatch(ref_dispatcher_first,
{ref_dispatch, []},
[{restart,permanent}, {shutdown,4000}, {maxr, 10}, {maxt,60},
{resources,10}, {watcher_type,named}]).
ok
3> ok = dispcount:start_dispatch(ref_dispatcher_second,
{ref_dispatch, []},
[{restart,permanent}, {shutdown,4000}, {maxr, 10}, {maxt,60},
{resources,10}, {watcher_type,named}]).
```

Without this patch second call will never return because of
`dispcount_serv:wait_for_dispatch(Name, infinity)` in `dispcount:start_dispatch/3`.

I also propose to crash, if it is impossible to start watchers (second commit).