各种有用的erlang行为
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

16 行
271 B

4 年前
4 年前
4 年前
4 年前
4 年前
  1. -module(pong1).
  2. -behavior(gen_server).
  3. -compile([export_all, nowarn_export_all]).
  4. start() ->
  5. gen_server:start(?MODULE, 0, []).
  6. init(_Args) ->
  7. {ok, 0}.
  8. handle_call(ping, _From, State) ->
  9. {reply, pong, State}.
  10. handle_cast(_Msg, State) ->
  11. {noreply, State}.