Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to describe gen_server visually?
    text
    copied!<p><em>Disclaimer: The author is a newbie in OTP having some basic knowledge of Erlang's syntax, processes and messages.</em></p> <p>I am trying to grasp the notion of behaviours in Erlang, but a lot of questions spring in my head preventing me from understanding the whole principle of such a behaviour like gen_server.</p> <p>Okay, the official documentation for gen_server shows a nice diagram of a server and three clients connected with Query and Reply arrows: <a href="http://www.erlang.org/doc/design_principles/gen_server_concepts.html" rel="noreferrer">http://www.erlang.org/doc/design_principles/gen_server_concepts.html</a></p> <p>But each time I try to understand the concept further, I get stuck.</p> <p>There is a lot of concepts which I cannot build into one larger concept in my head:</p> <ul> <li>behaviour implementation;</li> <li>behaviour container;</li> <li>behaviour interface; </li> <li>callback module;</li> <li>callback functions;</li> <li>API functions.</li> </ul> <p>I use the following resources:</p> <ul> <li>Erlang/OTP in Action book;</li> <li>Introduction to OTP behaviours presentation, <a href="http://www.slideshare.net/gamlidek/ceug-introduction-to-otp-behaviors-part-i-genserver" rel="noreferrer">http://www.slideshare.net/gamlidek/ceug-introduction-to-otp-behaviors-part-i-genserver</a>;</li> <li>'ErlyBank' at <a href="http://spawnlink.com/articles/an-introduction-to-gen_server-erlybank/index.html" rel="noreferrer">http://spawnlink.com/articles/an-introduction-to-gen_server-erlybank/index.html</a>.</li> </ul> <p>I am still in the state "we call one function in one module, this function calls the other function, that function creates a process... stuck"</p> <p><strong>Is there any way to describe the notion of gen_server in a diagram? How can an interaction flow between clients and a server be shown visually?</strong> (to help a not so smart newcomer to understand the concept visually)</p> <p>For example like here: <a href="http://support.novell.com/techcenter/articles/img/dnd2003080506.gif" rel="noreferrer">http://support.novell.com/techcenter/articles/img/dnd2003080506.gif</a></p> <p>UPD: I have tried to draw a diagram of my own, but I still don't get the purpose of any connector in the diagram: <a href="http://postimage.org/image/qe215ric/full/" rel="noreferrer">http://postimage.org/image/qe215ric/full/</a></p> <p>UPD2: This is something similar to what I would like to see: <a href="http://cryptoanarchy.org/wiki/Worker_patterns" rel="noreferrer">http://cryptoanarchy.org/wiki/Worker_patterns</a> (The Model). However, it doesn't show the interaction between modules, functions and processes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload