foo(X) -> gen_server:call(?Mod, {foo, X}). %% Write a gen_server handle call method like this: handle_call({foo, X}, From, State) -> State1 = func1(X, State), State2 = func2(X, State), spawn_link(fun() -> do_something(State1, X, From) end), {noreply, State2}. do_something(State, X, From) -> Reply = func3(X, State), gen_server:reply(From, Reply).
2011-04-20 03:58:18, 493 reviews, comment
send to mailbox
少女,不点下广告吗!
all by shitou
blog comments powered by Disqus