Mem
ETS based KV cache with TTL and LRU support
Usage
define your cache module
defmodule Cache douse Memendadd this module to supervisor
defmodule MyApp.Supervisor douse Supervisordef start_link doSupervisor.start_link(__MODULE__, [])enddef init([]) do[ Cache.child_spec,] |> supervise(strategy: :one_for_one)endendjust use it like redis
Cache.set(:a, 1)Cache.inc(:a, 2)Cache.set(:b, 2, 200)Cache.get(:a)Cache.expire(:a, 200)Cache.ttl(:a)Cache.del(:b)Cache.flushCache.hset(:c, :a, 2)Cache.hget(:c, :a)