dev-resources.site
for different kinds of informations.
#TIR: Build a Simple Persistent Key-Value Store in Elixir, using Logs - Part 1
Published at
12/9/2018
Categories
elixir
tir
Author
chenge
Author
6 person written this
chenge
open
Today I read it from Awesome Elixir Newsletter. Nice for learning Elixir.
def lookup(key) do
GenServer.call(__MODULE__, {:lookup, key})
end
def handle_call({:lookup, key}, _from, index_map) do
{:reply, get_key_offset_size(key, index_map), index_map}
end
defp get_key_offset_size(key, index_map) do
case Map.get(index_map, key) do
{_offset, _size} = offset_size -> {:ok, offset_size}
nil -> {:error, :not_found}
end
end
tir Article's
9 articles in total
Go Proverbs from @rob_pike
read article
#TIR: A call for Rust 2019 Roadmap blog posts
read article
#TIR: Plataformatec and Elixir: 2018 in review
read article
Recommend:illustration How does Unicorn work?
read article
Recommend: Anonymous Functions, Programming Elixir 1.6βββChapter 5
read article
Recommend: AST for JavaScript developers
read article
Recommend: Five Language Stories
read article
#TIR: Microservices Design Guide
read article
#TIR: Build a Simple Persistent Key-Value Store in Elixir, using Logs - Part 1
currently reading
Featured ones: