View Source BackBreeze.Cache behaviour (BackBreeze v0.4.2)
Defines the cache backend used by BackBreeze.
BackBreeze ships with BackBreeze.Cache.Default, which uses the cache
implementation provided by this package. Runtimes with different storage
capabilities can configure a backend of their own:
config :back_breeze, cache_backend: MyApp.BackBreezeCacheThe backend must be configured before :back_breeze is compiled.
Applications that need different cache behavior are responsible for providing
that implementation.
Summary
Types
@type cache() :: :render | :stable | :prepared
@type cache_scope() :: :render | :prepared
Callbacks
@callback advance_generation() :: :ok
@callback children() :: [Supervisor.child_spec()]
@callback clear(cache_scope()) :: :ok
@callback max_memory_bytes() :: non_neg_integer()
@callback size(cache_scope()) :: non_neg_integer()