Created
May 18, 2016 16:07
-
-
Save elbrujohalcon/b903be014ae8013cd9f2d31ce14c406b to your computer and use it in GitHub Desktop.
For my post @ Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(dumb_math). | |
-export([dup/1, init/1]). | |
dup(X) -> | |
case gen_server:start_link(dumb_math, X, []) of | |
{ok, Pid} -> sys:get_state(Pid); | |
{error, Reason} -> Reason | |
end. | |
init(X) when is_number(X) -> {ok, X * 2}; | |
init(_) -> {stop, notnum}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment