Created
January 17, 2019 12:28
-
-
Save NJichev/3a95e7c5cbb73a0b7c956f80ad6ef78a 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
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