Commits

Fred T-H committed 3703cab

moving the ugly unlinking from the server to the client

  • Participants
  • Parent commits 52ec555

Comments (0)

Files changed (2)

 %% Description: Removes a client's listener from a given user.
 %%--------------------------------------------------------------------
 disconnect(Id, HandlerId) ->
-    usr:unsubscribe(Id, HandlerId).
+    usr:unsubscribe(Id, HandlerId),
+    %% leftover link from the event manager. Total break of
+    %% encapsulation here, but is needed to deal with process pools.
+    unlink(global:whereis_name({manager,Id})).
 
 %%--------------------------------------------------------------------
 %% Function: message(From, To, Message) -> ok

src/web_server.erl

     Msgs = client:listen(Nick,Handler),
     JSON = mochijson2:encode([json_prepare(M) || M <- Msgs]),
     client:disconnect(Nick, Handler),
-    %% mochiweb uses a process pool. We work around that here. aack :(
-    unlink(global:whereis_name({manager,Nick})),
     reply(Req, JSON, Params);
 
 handle("/history", Req) ->