View Source Nebulex.Adapters.Horde (nebulex_adapters_horde v1.0.1)

Nebulex adapter for Horde.

NOTE: This adapter only supports Nebulex v2.0.0 onwards.

overall-features

Overall features

  • In-memory data storage in GenServer, distributed relying on Horde with CRDT.
  • Every cache entry is a process supervised by Horde.
  • Expired entries are lost forever (process termination).
  • Processes hand-off with graceful shutdown thanks to Horde.
  • Configurable primary storage adapter.
  • Support for transactions via Erlang global name registration facility.
  • Stats support rely on the primary storage adapter.

configuration

Configuration

You can define a cache using Horde as follows:

defmodule MyApp.Cache do
  use Nebulex.Cache,
    otp_app: :my_app,
    adapter: Nebulex.Adapters.Horde,
    horde: [
      members: :auto,
      process_redistribution: :passive
      # any other horde configs
    ]
end

And in the application.ex file:

def start(_type, _args) do
  children = [
    {MyApp.Cache, []},
  ]
  ...
end