PhoenixGenApi.ConfigCache (PhoenixGenApi v0.0.13)

View Source

This 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

add(request_config)

@spec add(PhoenixGenApi.Structs.FunConfig.t()) :: :ok

Add a new config to cache.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete(request_type)

@spec delete(String.t()) :: :ok

Delete a config from cache.

get(request_type)

Get a config from cache.

get_all_keys()

@spec get_all_keys() :: [String.t()]

Get all keys in cache.

start_link(opts \\ [])

Start the cache.

update(request_config)

@spec update(PhoenixGenApi.Structs.FunConfig.t()) :: :ok | {:error, String.t()}

Update a config in cache.