pay_day_loan v0.5.1 PayDayLoan.KeyCache

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.

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

Functions

add_to_cache(table_id, key)
add_to_cache(atom, PayDayLoan.key) :: boolean

Add a key to the cache

exist?(table_id, callback_module, key)
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.

in_cache?(table_id, key)
in_cache?(atom, PayDayLoan.key) :: boolean

Returns true if the key is in cache

lookup?(table_id, callback_module, key)
lookup?(atom, module, PayDayLoan.key) :: boolean

Calls callback_module.key_exists?(key), adds key to cache if the callback returns true

remove(table_id, key)
remove(atom, PayDayLoan.key) :: :ok

Remove a key from the cache