Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-m-i-t-a/memo_memcache
A memcache storage for memo library
https://github.com/s-m-i-t-a/memo_memcache
elixir hacktoberfest
Last synced: 5 days ago
JSON representation
A memcache storage for memo library
- Host: GitHub
- URL: https://github.com/s-m-i-t-a/memo_memcache
- Owner: s-m-i-t-a
- License: other
- Created: 2018-10-17T04:38:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T12:00:45.000Z (about 6 years ago)
- Last Synced: 2024-10-30T16:56:29.586Z (14 days ago)
- Topics: elixir, hacktoberfest
- Language: Elixir
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MemoMemcache
`MemoMemcache` is the adapter between the [Memo library](https://github.com/s-m-i-t-a/memo)
and memcached (specifically [Memcachir](https://github.com/peillis/memcachir)).## Installation
```elixir
def deps do
[
{:memo_memcache, "~> 1.0.0"}
]
end
```## Use
For the correct use `Memcachier` must be configured (`config/config.exs` content):
```elixir
config :memcachir,
hosts: System.get_env("MEMCACHE_SERVERS") || "localhost:11211",
ttl: System.get_env("MEMCACHE_DEFAULT_TTL") || 172_800,
coder: Memcache.Coder.Erlang,
auth: {
:plain,
System.get_env("MEMCACHE_USERNAME"),
System.get_env("MEMCACHE_PASSWORD")
}
```then you can use `MemoMemcache` as a cache in the `Memo.memoize`:
```elixir
Memo.memoize(Kernel, :div, [5, 2], cache: MemoMemcache)
```## License
[BSD3](https://github.com/s-m-i-t-a/memo_memcache/blob/master/LICENSE)
----
Created: 2018-10-17Z