wrf.get_cached_item

wrf.get_cached_item(key, product)

Return an item from the threadlocal cache.

The cache should be viewed as two nested dictionaries. The outer key is usually the id for the sequence where the cached item was generated. The inner key is the product type.

Retrieving a cached item behaves like:

value = cache[key][product]

The cache is thread local, so stored items are only available in the thread that cached them.

Parameters:
  • key (int) – The outer dictionary cache key, which is typically the id of the sequence where the cached item was generated.

  • product (str) – The inner dictionary cache key, which is a string for the product type.

Returns:

The cached object.

Return type:

object

See also

cache_item()