Skip to content

Instantly share code, notes, and snippets.

@IvanIvanoff
Created May 12, 2016 20:11
Show Gist options
  • Save IvanIvanoff/91065707c62d5c4542225a45766ac7d0 to your computer and use it in GitHub Desktop.
Save IvanIvanoff/91065707c62d5c4542225a45766ac7d0 to your computer and use it in GitHub Desktop.
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