Created
May 12, 2016 20:11
-
-
Save IvanIvanoff/91065707c62d5c4542225a45766ac7d0 to your computer and use it in GitHub Desktop.
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
def handle_cast({:create, name}, names) do | |
if Map.has_key?(names, name) do | |
{:noreply, names} | |
else | |
{:ok, bucket} = KV.Bucket.start_link | |
{:noreply, Map.put(names, name, bucket)} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment