3
在項目gproc的文件gen_leader.erl中,創建了自定義行爲。但是在下面的語句中,模塊「gen」是什麼?我在「erlang文檔工具http://www.erlang.org/erldoc」中找不到這個模塊?你能給我一些解釋嗎?什麼是gen:開始意思?
behaviour_info(callbacks) ->
[{init,1},
{elected,2},
{surrendered,3},
{handle_leader_call,4},
{handle_leader_cast,3},
{handle_local_only, 4},
{from_leader,3},
{handle_call,3},
{handle_cast,2},
{handle_DOWN,3},
{handle_info,2},
{terminate,2},
{code_change,4}];
behaviour_info(_Other) ->
undefined.
start_link(Name, [_|_] = CandidateNodes, Workers,
Mod, Arg, Options) when is_atom(Name) ->
gen:start(?MODULE, link, {local,Name}, Mod, %<<++++++ What's the meaning?
{CandidateNodes, Workers, Arg}, Options).
非常感謝。 – 2012-02-24 03:50:43