Skip to content

Instantly share code, notes, and snippets.

@NJichev
Created January 17, 2019 12:28
Show Gist options
  • Save NJichev/3a95e7c5cbb73a0b7c956f80ad6ef78a to your computer and use it in GitHub Desktop.
Save NJichev/3a95e7c5cbb73a0b7c956f80ad6ef78a to your computer and use it in GitHub Desktop.
defprotocol Store do
@callback new() :: t
def save(id, value)
end
defmodule InMemory do
defstruct [:pid]
@behaviour Store
defimpl Store do
def save(_id, _value) do
# ... implementation ...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment