各种有用的erlang行为
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

16 lignes
271 B

il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
  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}.