Commits

Fred T-H committed 29cd9be

fighting the markdown

Comments (0)

Files changed (1)

 Different event handlers attached to the event manager will be dealing with routing messages:
 
 * //chut_user_dispatch_handler//: Takes messages you send and routes them to another user. There is only one of these per user.
-* //chut_user_listen_handler//: Takes any kind of message received and transmits it to the client. The format of the message is altered to be {{UserId, HandlerId}, {received, From, Message}} or {{UserId, HandlerId}, {sent, To, Message}} so a given process can hold more than one client connection. There is one handler of this kind per client and each of them is added with gen_event:add_sup_handler/3, which guarantees that if the client dies, the handler also dies (the opposite is also true, except for a normal exit).
+* //chut_user_listen_handler//: Takes any kind of message received and transmits it to the client. The format of the message is altered to be {{UserId, HandlerId}, {received, From, Message} } or {{UserId, HandlerId}, {sent, To, Message} } so a given process can hold more than one client connection. There is one handler of this kind per client and each of them is added with gen_event:add_sup_handler/3, which guarantees that if the client dies, the handler also dies (the opposite is also true, except for a normal exit).
 
 Another handler, namely //chut_user_history_handler//, exists with the sole purpose of accumulating the messages sent through a user. When the notification {From, history} (where //From// is a PID) is sent, this handler will send back a list of recent messages routed through the user.