Commits

Fred T-H committed ea3063a

Moving the process registration of the monitor to its init function

(This commit message also deals with rev 6159d3220cce)
Two reasons for this move: 1. it is against the type specs of
the gen_fsm module to have a global name that isn't an atom;
2. going through gen_fsm:start_link/3-4 to do the registration
doesn't allow to use global's conflict resolving functions.

Some minor cleanup has also been done with the supervisor.

  • Participants
  • Parent commits 620fb3a

Comments (0)

Files changed (1)

src/chut_user_sup.erl

 %% a user work properly.
 %%--------------------------------------------------------------------
 init([UserId, TimeOut]) ->
-    MonitorId = {monitor, UserId},
-    ManagerId = {manager, UserId},
-    MonitorSpec = {MonitorId,
-                   {chut_user_monitor, start_link, [UserId, ManagerId, TimeOut]},
+    MonitorSpec = {monitor,
+                   {chut_user_monitor, start_link, [UserId, TimeOut]},
                    transient,
                    TimeOut,
                    worker,
                    [chut_user_monitor]},
-    ManagerSpec = {ManagerId,
+    ManagerSpec = {manager,
                    {chut_user_manager, start_link, [UserId]},
                    transient,
                    TimeOut,