Fred T-H  committed bbc77f5

Moving the registration of the user supervisor process outside of the
spawn_link function.

Same advantage as for moving then monitor and manager: respect of
specs and being able to use conflict resolving function.

  • Participants
  • Parent commits 6796a9e
  • Branches default

Comments (0)

Files changed (1)

File src/chut_user_sup.erl

 start_link(UserId, TimeOut) ->
-    supervisor:start_link({global, UserId}, ?MODULE, [UserId, TimeOut]).
+    supervisor:start_link(?MODULE, [UserId, TimeOut]).
 %% a user work properly.
 init([UserId, TimeOut]) ->
+    global:register_name(UserId, self()),
     MonitorSpec = {monitor,
                    {chut_user_monitor, start_link, [UserId, TimeOut]},