ClusterHelper.Adapter (ClusterHelper v1.0.0)

Copy Markdown View Source

Registry for ClusterHelper pluggable adapters.

Each subsystem (broadcast, role store, remote sync) is defined as a behaviour and can be swapped at the application config level:

config :cluster_helper, ClusterHelper.Adapter,
  broadcast: ClusterHelper.Broadcast.PG,
  role_store: ClusterHelper.ETSStore,
  remote_sync: ClusterHelper.RemoteSync.ERPC

When no config is given each type falls back to its default adapter listed above, so existing projects work without any configuration change.

Summary

Functions

Returns the configured adapter module for the given type.

Types

adapter_type()

@type adapter_type() :: :broadcast | :role_store | :remote_sync

Functions

for(adapter_type)

@spec for(adapter_type()) :: module()

Returns the configured adapter module for the given type.

Config can be a map or keyword list (both are common in Elixir config).