View Source Flowy.Support.Cache.MemoryStore (Flowy v0.1.4)
A simple in-memory cache store backed by ETS
Options
:ttl
(integer/0
) - the time-to-live for a key in seconds. Default to 5 minutes. The default value is300
.
Summary
Functions
Returns a specification to start this module under a supervisor.
Delete a value from the cache
Fetch a value from the cache, or write the result of the function to the cache if the key does not exist.
Read a value from the cache.
Reset the cache
Write a value to the cache
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec delete(String.t()) :: {:error, :not_found} | {:ok, :deleted}
Delete a value from the cache
Fetch a value from the cache, or write the result of the function to the cache if the key does not exist.
Read a value from the cache.
@spec reset() :: true
Reset the cache
Write a value to the cache