Created
May 17, 2017 13:28
-
-
Save nsomar/65163eea61eda0ec49d5a3dd44a180db to your computer and use it in GitHub Desktop.
This file contains 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
def async(mod, fun, args) do | |
mfa = {mod, fun, args} | |
owner = self() | |
pid = Task.Supervised.spawn_link(owner, get_info(owner), mfa) | |
ref = Process.monitor(pid) | |
send(pid, {owner, ref}) | |
%Task{pid: pid, ref: ref, owner: owner} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment