Question

In One major difference - ZeroMQ and Erlang author mentions briefly "request as a process" idea. I'm new to Erlang and I'd like to see an example or an article how to do it.

Any resource or hint will be highly appreciated.

Was it helpful?

Solution

I am a newbie too but to me the idea seems simple. For each request, whatever it is, spawn a new process and let it handle the request. That is all. This guy talks about that too: http://vimeo.com/19806728

So my understanding is that when you receive a request, you spawn a process by calling spawn(Module, Name, Args), or another variant of this function (see http://www.erlang.org/doc/reference_manual/processes.html) and pass the request data in the Args list. Module and Name identify a function that is executed when the process starts and that deals with the Args.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top