Events/Observer pattern

Matthias Lang matthias@REDACTED
Thu Nov 24 13:47:28 CET 2005

Your suggested implementation sounds fine.

I don't think there's anything in the standard library which does

And even if there was, it'd probably take you less time to just
implement it than it would to figure out how to use someone else's.


doublec writes:

 > I want to have a process that sends information out to other
 > processes at regular intervals. Those other processes should be
 > able to register to receive information or unregister to stop
 > receiving them. Classic 'observer' pattern stuff in OO.
 > I thought of having the information provider process accept pid's
 > on register, and when it needs to send out the information it just
 > goes over the list of pid's sending a message to the receiver.
 > Is that a reasonable approach? Is there anything in the standard
 > library that provides this functionality already that I should be
 > looking at?

More information about the erlang-questions mailing list