PhoenixGenApi.ConfigCache (PhoenixGenApi v0.0.13)
View SourceThis module provides a cache for Executor
can get %FunConfig{}
config by request_type
.
Use :ets
to store config in memory.
Application can add, update, delete, get config from this cache.
PhoenixGenApi.ConfigPuller
will pull config from nodes and update to this cache.
Summary
Functions
Add a new config to cache.
Returns a specification to start this module under a supervisor.
Delete a config from cache.
Get a config from cache.
Get all keys in cache.
Start the cache.
Update a config in cache.
Functions
@spec add(PhoenixGenApi.Structs.FunConfig.t()) :: :ok
Add a new config to cache.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec delete(String.t()) :: :ok
Delete a config from cache.
@spec get(String.t()) :: PhoenixGenApi.Structs.FunConfig.t() | nil
Get a config from cache.
@spec get_all_keys() :: [String.t()]
Get all keys in cache.
Start the cache.
@spec update(PhoenixGenApi.Structs.FunConfig.t()) :: :ok | {:error, String.t()}
Update a config in cache.