摘要:
RestartStrategy = one_for_one,%%simple_one_for_one不支持子节点为空,会启动出错** exception exit: bad_start_spec,具体原因待查 MaxRestart = 1000, MaxSecondsBetweenRestart = 10, SupFlag = {RestartStrategy, MaxRestart, MaxSecondsBetweenRestart}, io:format("game_service_sup starting......~n"), {ok, {SupFlag, []}}. 阅读全文
摘要:
代码:View Code 1 -module(lib_misc). 2 -export([pmap/2]). 3 -import(lists, [foreach/2]). 4 5 pmap(F, L) -> 6 S = self(), 7 %%Ref = erlang:make_ref(), 8 lists:foreach(fun(I)-> 9 spawn(fun() ->do_f(S, F, I) end)10 end, L),11 gether(length(L), []).12 ... 阅读全文