Skip to content

Instantly share code, notes, and snippets.

@tdx
Created April 12, 2011 04:23
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 tdx/914926 to your computer and use it in GitHub Desktop.
Save tdx/914926 to your computer and use it in GitHub Desktop.
Resource Acquisition Is Initialization paradigm
%% @hidden
init([]) ->
Ip0 = application:get_env(riak_pb_ip),
Port0 = application:get_env(riak_pb_port),
case {Ip0,Port0} of
{{ok,Ip},{ok,Port}} when is_integer(Port) ->
self() ! {start_pool, Ip, Port}; %% need handle_info implement
_ -> ok
end,
{ok, undefined}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment