ResourceCache.Callbacks (Resource Cache v0.0.4) View Source

Link to this section Summary

Link to this section Types

Specs

configure_hook() :: (() -> :ok | :unhook) | {atom(), term(), term()}

Specs

init_hook() :: (cache :: module() -> :ok | :unhook) | {atom(), term(), term()}

Specs

pre_update_hook() ::
  (cache :: module(), data :: [ResourceCache.resource()] -> :ok | :unhook)
  | {atom(), term(), term()}

Specs

t() :: %ResourceCache.Callbacks{
  configure: [configure_hook()],
  init: [init_hook()],
  pre_update: [pre_update_hook()],
  update: [ResourceCache.hook()]
}

Link to this section Functions

Link to this function

configure(callbacks, cache)

View Source

Specs

configure(t(), module()) :: {:ok, t()}

Specs

empty?(t()) :: boolean()

Specs

from_opts(Keyword.t()) :: {t(), opts :: Keyword.t()}

Specs

merge(t(), t()) :: t()
Link to this function

pre_update(callbacks, cache, data)

View Source

Specs

pre_update(t(), module(), [ResourceCache.resource()]) :: {:ok, t()}

Specs

sanitize(t()) :: t()
Link to this function

unhook(callbacks, hooks)

View Source

Specs

unhook(t(), (... -> any()) | [(... -> any())]) :: t()
Link to this function

update(callbacks, cache, changeset)

View Source

Specs

update(t(), module(), ResourceCache.Changeset.t()) :: {:ok, t()}