Skip to content

Instantly share code, notes, and snippets.

@wardbekker
Created September 9, 2011 07:00
Show Gist options
  • Save wardbekker/1205645 to your computer and use it in GitHub Desktop.
Save wardbekker/1205645 to your computer and use it in GitHub Desktop.
get_keyword_server(Keyword) ->
ServerName = keyword_server_name(Keyword),
ServerProcessName = list_to_atom(ServerName),
case whereis(ServerProcessName) of
undefined ->
{ok, Pid} = supervisor:start_child(keyword_sup, [ServerProcessName]);
Pid ->
Pid
end,
Pid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment