Skip to content

Instantly share code, notes, and snippets.

@dnet
Created March 12, 2014 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnet/9505053 to your computer and use it in GitHub Desktop.
Save dnet/9505053 to your computer and use it in GitHub Desktop.
Erlang workshop code from 2013-11-21 see http://hsbp.org/erlang#Workshop
-module(teszt).
-export([init/1, handle_call/3, q/1, init/0]).
-behaviour(gen_server).
init() ->
gen_server:start_link(?MODULE, [], []).
q(Pid) -> gen_server:call(Pid, q).
init([]) -> {ok, 0}.
handle_call(q, _, N) -> {reply, N, N + 1}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment