Bandera. Store. TwoLevel
(bandera v0.1.0)
Copy Markdown
Default store: an ETS cache in front of a persistent adapter. Whether the cache
is consulted is decided per-call from the runtime Bandera.Config snapshot
(read from :persistent_term), so caching can be toggled at runtime with no
recompilation. The persistent adapter is also runtime-selected.
Examples
iex> alias Bandera.Store.TwoLevel
iex> TwoLevel.put(:demo, Bandera.Gate.new(:boolean, true))
iex> {:ok, flag} = TwoLevel.lookup(:demo)
iex> flag.gates
[%Bandera.Gate{type: :boolean, for: nil, enabled: true}]