September 2013
Intermediate to advanced
548 pages
12h 25m
English
Now that we understand the idea, we’ll take a more detailed look at the
gen_server callback
structure.
The call gen_server:start_link(Name, Mod, InitArgs, Opts) starts
everything. It creates a generic server
called Name. The callback module
is Mod. Opts controls the behavior of the
generic server. Here we can specify the logging of messages,
debugging of functions, and so on. The generic server starts by
calling Mod:init(InitArgs).
The template entry for init is shown in Figure 2, init template entry
(the full template can be found in
The Generic Server Template):
| | %%-------------------------------------------------------------------- |
| | %% @private |
| | %% @doc |
| | %% Initializes the ... |
Read now
Unlock full access