Created
May 17, 2017 13:25
-
-
Save nsomar/1d6bc4a1ef67972822e0584b7843e412 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
defmodule Utilities do | |
def write(content, file) do | |
# get th target process | |
target = self() | |
spawn(fn -> | |
# write stuff to disk | |
# takes long time | |
# send a message to it | |
send(target, result_of_write) | |
end) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment