Packages
A Nebulex adapter for Cachex
Current section
Files
Jump to
Current section
Files
lib/nebulex/adapters/cachex/router.ex
defmodule Nebulex.Adapters.Cachex.Router do
@moduledoc false
import Nebulex.Utils
alias Cachex.Router, as: CachexRouter
alias Cachex.Services.Overseer
## API
@doc """
Helper function to route custom actions.
"""
def route(name, {action, _args} = call) do
Overseer.with(name, fn cachex_cache ->
module = camelize_and_concat([Nebulex.Adapters.Cachex.CustomActions, action])
CachexRouter.route(cachex_cache, module, call)
end)
end
end