View Source Nebulex.Adapter behaviour (Nebulex v2.6.4)
Specifies the minimal API required from adapters.
Summary
Callbacks
The callback invoked in case the adapter needs to inject code.
Initializes the adapter supervision tree by returning the children.
Types
Callbacks
@macrocallback __before_compile__(env :: Macro.Env.t()) :: Macro.t()
The callback invoked in case the adapter needs to inject code.
@callback init(config :: Keyword.t()) :: {:ok, :supervisor.child_spec(), adapter_meta()}
Initializes the adapter supervision tree by returning the children.
Functions
Helper macro for the adapters so they can add the logic for emitting the recommended Telemetry events.
See the built-in adapters for more information on how to use this macro.
Executes the function fun
passing as parameters the adapter and metadata
(from the init/1
callback) associated with the given cache name_or_pid
.
It expects a name or a PID representing the cache.