I agree that this certainly looks nicer than defining a callback.
However this is not "event-driven", but more like
"wait-for-that-driven". Code like this also results in all concurrent
activities being blocked, as the selective receives involved will make
all other messages queue up and wait. As soon as you need to handle
concurrent events, you will end up implementing a common dispatcher with
callbacks, just like in gen_servers.
Zoltan.
Yves S. Garret wrote:
> Well, Erlang certainly does a good job of taking care of those
> details.
>> On Jan 15, 9:52 pm, Jayson Vantuyl <> wrote:
>>> One of the things that drove me to Erlang was that it neatly encapsulates event-driven programming. I loved writing code in Twisted and EventMachine, but I hated the mess of little blocks of code that it created. I realized during a discussion recently that the relation may not be obvious to someone who hasn't done either of those things before. So, I blogged about it. Enjoy:
>>>>http://ta.gd/erlang_evented>>>> --
>> Jayson Vantuyl
>>>>>> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html> erlang-questions (at) erlang.org
>>>