Cache.Redis (elixir_cache v0.3.9)
View SourceRedis adapter for distributed caching with ElixirCache.
This adapter provides a connection pool to Redis, enabling distributed caching across multiple nodes or services. It supports the standard Cache behavior plus additional Redis-specific operations like hash manipulation, JSON operations, and sets.
Features
- Connection pooling for efficient Redis access
- Support for Redis URI connection strings
- Hash operations for storing field-value pairs within a key
- JSON operations for working with complex nested data structures
- Set operations for managing collections
- Direct access to Redis commands via pipeline and command functions
Options
:uri
(String.t/0
) - Required. The connection uri to redis:size
(pos_integer/0
) - The amount of workers in the pool:max_overflow
(pos_integer/0
) - The amount of max overflow the pool can handle:strategy
- The type of queue to use for poolboy
Example
defmodule MyApp.RedisCache do
use Cache,
adapter: Cache.Redis,
name: :my_app_redis_cache,
opts: [
uri: "redis://localhost:6379",
size: 10,
max_overflow: 5
]
end
Summary
Functions
See Cache.Redis.Global.command/3
.
See Cache.Redis.Global.command!/3
.
See Cache.Redis.Hash.hash_delete/4
.
See Cache.Redis.Hash.hash_get/4
.
See Cache.Redis.Hash.hash_get_all/3
.
See Cache.Redis.Hash.hash_get_many/3
.
See Cache.Redis.Hash.hash_scan/4
.
See Cache.Redis.Hash.hash_set/6
.
See Cache.Redis.Hash.hash_set_many/4
.
See Cache.Redis.Hash.hash_values/3
.
See Cache.Redis.JSON.array_append/5
.
See Cache.Redis.JSON.clear/4
.
See Cache.Redis.JSON.delete/4
.
See Cache.Redis.JSON.get/4
.
See Cache.Redis.JSON.incr/5
.
See Cache.Redis.JSON.set/5
.
See Cache.Redis.Global.pipeline/3
.
See Cache.Redis.Global.pipeline!/3
.
See Cache.Redis.Set.sadd/4
.
See Cache.Redis.Global.scan/3
.
See Cache.Redis.Set.smembers/3
.
Functions
See Cache.Redis.Global.command/3
.
See Cache.Redis.Global.command!/3
.
See Cache.Redis.Hash.hash_delete/4
.
See Cache.Redis.Hash.hash_get/4
.
See Cache.Redis.Hash.hash_get_all/3
.
See Cache.Redis.Hash.hash_get_many/3
.
See Cache.Redis.Hash.hash_scan/4
.
See Cache.Redis.Hash.hash_set/6
.
See Cache.Redis.Hash.hash_set_many/4
.
See Cache.Redis.Hash.hash_values/3
.
See Cache.Redis.JSON.array_append/5
.
See Cache.Redis.JSON.clear/4
.
See Cache.Redis.JSON.delete/4
.
See Cache.Redis.JSON.get/4
.
See Cache.Redis.JSON.incr/5
.
See Cache.Redis.JSON.set/5
.
See Cache.Redis.Global.pipeline/3
.
See Cache.Redis.Global.pipeline!/3
.
See Cache.Redis.Set.sadd/4
.
See Cache.Redis.Global.scan/3
.
See Cache.Redis.Set.smembers/3
.