Higher order receieve anybody

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Tue Feb 24 10:22:08 CET 2004


From: "Ulf Wiger" <ulf.wiger@REDACTED>
> Handling system messages is the one area where I've found it
> necessary to raise the abstraction level above what 'receive'
> provides. There are workarounds -- they are called gen_server
> and gen_fsm, but they have the unfortunate side-effect of
> imposing an un-erlangish message reception paradigm on the
> unsuspecting user.

I agree fully.

> I would like to see the possibility to divide messages into
> two separate categories: administrative (such as suspend,
> resume, inspect, upgrade) and operative (whatever the program
> is _really_ supposed to do. And I would like to be able to keep
> them separated without messing up the programming semantics.

I could even imagine such a separation hard-wired into the language (i.e. the
normal receive would work like Ulf's extended receive). Yes, there would be a
change in semantics, but almost no one would notice it because normal uses are
not affected. Handling system messages would be done behind the scenes by a
default handler, but this should be customizable.

Then the next generation of gen_server and friends will look a lot more like
regular processes! :-)

regards,
Vlad





More information about the erlang-questions mailing list