Lotus.Cache.Cachex (Lotus v0.10.0)

View Source

A Cachex-based, local or distributed, in-memory cache adapter for Lotus.

This adapter requires the Cachex library. Please add {:cachex, "~> 4.0"} to your dependencies.

Example configuration in config/config.exs:

config :lotus, :cache,
  adapter: Lotus.Cache.Cachex,
  cachex_opts: [limit: 1_000_000] # Optional Cachex options

See Cachex documentation for available options. By default, Cachex will use a local-only routing strategy. To enable distributed caching, you can choose your preferred router by following the instructions in the Cachex docs.

Summary

Functions

decode(bin)

See Lotus.Cache.Adapter.decode/1.

encode(value, compress \\ true)

See Lotus.Cache.Adapter.encode/2.