Cachex.Policy behaviour (Cachex v3.4.0) View Source

Module controlling policy behaviour definitions.

This module purely exposes the behaviour and convenience macros for creating a custom policy. It's used internally be Cachex.Policy.LRW and provides very little more than an interface to adhere to.

Link to this section Summary

Callbacks

Returns an optional child spec to start for this policy.

Returns any hook definitions required for this policy.

Returns the Supervisor strategy for this policy.

Link to this section Callbacks

Specs

child_spec(Spec.limit()) :: Supervisor.Spec.spec()

Returns an optional child spec to start for this policy.

Specs

hooks(Spec.limit()) :: [Spec.hook()]

Returns any hook definitions required for this policy.

Specs

strategy() :: Supervisor.Spec.strategy()

Returns the Supervisor strategy for this policy.