Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

ciukes

By: a guest on May 27th, 2008  |  syntax: None  |  size: 0.65 KB  |  hits: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. -module(pp).
  2. -behaviour(gen_server).
  3. -compile(export_all).
  4. -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
  5.          terminate/2, code_change/3]).
  6.  
  7. init([]) -> {ok, "value"}.
  8.  
  9. start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], [{debug,[trace]}]).
  10. start() -> gen_server:start({local, ?MODULE}, ?MODULE, [], [{debug,[trace]}]).
  11. alloc(Pid) -> gen_server:call(?MODULE, {alloc, Pid}).
  12.  
  13. handle_call({alloc, Pid}, From, State) ->
  14.    {noreply, State}.
  15.  
  16. handle_cast(_Msg, State) -> {noreply, State}.
  17. handle_info(_Info, State) -> {noreply, State}.
  18. terminate(_Reason, _State) -> ok.
  19. code_change(_OldVsn, State, Extra) -> {ok, State}.