[erlang-questions] eep: multiple patterns
Fri May 30 00:52:22 CEST 2008
Ulf Wiger wrote:
> Dave Peticolas skrev:
>> Could you expand on this point for the benefit
> > of the newbies? :)
>> I'm not clear about what exactly is the problem
> > with gen_server's message handling and what the
> > better approach is.
> The problem is not with gen_server, which is wonderful
> for implementing client-server patterns.
> The issue is with FIFO message handling, at least when
> used for complex state machines. It is very difficult
> to write a behavior that lets the user have control
> over selective message reception. In selective receive,
> you can use only patterns and guards, and neither can
> be extended with user-defined logic via a callback
> Here are some slides from EUC 2005 on the topic:
> You could read the thread:
> "plain_fsm - for beginners and purists"
> from 2004:
> and then the "higher-order receive anybody" thread:
> This most likely give you more detail than you asked for. (:
Not at all, it is very informative, thanks!
More information about the erlang-questions