PayDayLoan.KeyCache (pay_day_loan v0.8.2)
Keeps track of which keys are known to exist in the cache source
You shouldn't need to call these functions manually, but they can be useful for debugging.
Link to this section Summary
Functions
Add a key to the cache
Returns true if the key exists either in the key cache or source
Returns true if the key is in cache
Calls callback_module.key_exists?(key)
, adds key to cache if the
callback returns true
Remove a key from the cache
Link to this section Functions
Link to this function
add_to_cache(table_id, key)
@spec add_to_cache(atom(), PayDayLoan.key()) :: boolean()
Add a key to the cache
Link to this function
exist?(table_id, callback_module, key)
@spec exist?(atom(), module(), PayDayLoan.key()) :: boolean()
Returns true if the key exists either in the key cache or source
Calls callback_module.key_exists?(key)
if the key is not
already in cache.
Link to this function
in_cache?(table_id, key)
@spec in_cache?(atom(), PayDayLoan.key()) :: boolean()
Returns true if the key is in cache
Link to this function
lookup?(table_id, callback_module, key)
@spec lookup?(atom(), module(), PayDayLoan.key()) :: boolean()
Calls callback_module.key_exists?(key)
, adds key to cache if the
callback returns true
Link to this function
remove(table_id, key)
@spec remove(atom(), PayDayLoan.key()) :: :ok
Remove a key from the cache